mirror of
https://github.com/usememos/memos.git
synced 2024-12-27 15:42:51 +08:00
fix user update patch null checker
This commit is contained in:
parent
3dc71a6ec7
commit
1edf40ef69
1 changed files with 3 additions and 3 deletions
|
@ -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) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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{
|
||||||
|
|
Loading…
Reference in a new issue