Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
1edf40ef
Commit
1edf40ef
authored
Dec 12, 2021
by
steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix user update patch null checker
parent
3dc71a6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
user.go
api/user.go
+3
-3
No files found.
api/user.go
View file @
1edf40ef
...
@@ -37,7 +37,7 @@ func handleUpdateMyUserInfo(w http.ResponseWriter, r *http.Request) {
...
@@ -37,7 +37,7 @@ func handleUpdateMyUserInfo(w http.ResponseWriter, r *http.Request) {
return
return
}
}
if
*
userPatch
.
Username
!=
""
{
if
userPatch
.
Username
!=
nil
{
usernameUsable
,
_
:=
store
.
CheckUsernameUsable
(
*
userPatch
.
Username
)
usernameUsable
,
_
:=
store
.
CheckUsernameUsable
(
*
userPatch
.
Username
)
if
!
usernameUsable
{
if
!
usernameUsable
{
json
.
NewEncoder
(
w
)
.
Encode
(
Response
{
json
.
NewEncoder
(
w
)
.
Encode
(
Response
{
...
@@ -49,7 +49,7 @@ func handleUpdateMyUserInfo(w http.ResponseWriter, r *http.Request) {
...
@@ -49,7 +49,7 @@ func handleUpdateMyUserInfo(w http.ResponseWriter, r *http.Request) {
}
}
}
}
if
*
userPatch
.
GithubName
!=
""
{
if
userPatch
.
GithubName
!=
nil
{
githubNameUsable
,
_
:=
store
.
CheckGithubNameUsable
(
*
userPatch
.
GithubName
)
githubNameUsable
,
_
:=
store
.
CheckGithubNameUsable
(
*
userPatch
.
GithubName
)
if
!
githubNameUsable
{
if
!
githubNameUsable
{
json
.
NewEncoder
(
w
)
.
Encode
(
Response
{
json
.
NewEncoder
(
w
)
.
Encode
(
Response
{
...
@@ -61,7 +61,7 @@ func handleUpdateMyUserInfo(w http.ResponseWriter, r *http.Request) {
...
@@ -61,7 +61,7 @@ func handleUpdateMyUserInfo(w http.ResponseWriter, r *http.Request) {
}
}
}
}
if
*
userPatch
.
WxOpenId
!=
""
{
if
userPatch
.
WxOpenId
!=
nil
{
wxOpenIdUsable
,
_
:=
store
.
CheckWxOpenIdUsable
(
*
userPatch
.
GithubName
)
wxOpenIdUsable
,
_
:=
store
.
CheckWxOpenIdUsable
(
*
userPatch
.
GithubName
)
if
!
wxOpenIdUsable
{
if
!
wxOpenIdUsable
{
json
.
NewEncoder
(
w
)
.
Encode
(
Response
{
json
.
NewEncoder
(
w
)
.
Encode
(
Response
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment