Skip to content

Commit

Permalink
[fix] #34 #42 Issueの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yoneyan committed Feb 20, 2021
1 parent 6f70cfc commit a2de50a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/api/core/user/v0/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ func MailVerify(c *gin.Context) {

result := dbUser.Get(user.MailToken, &user.User{MailToken: mailToken})
if result.Err != nil {
c.JSON(http.StatusInternalServerError, common.Error{Error: result.Err.Error() + "| we can't find token data"})
c.JSON(http.StatusBadRequest, common.Error{Error: result.Err.Error() + "| we can't find token data"})
return
}

if *result.User[0].MailVerify {
c.JSON(http.StatusInternalServerError, common.Error{Error: fmt.Sprintf("This email has already been checked")})
c.JSON(http.StatusBadRequest, common.Error{Error: fmt.Sprintf("This email has already been checked")})
return
}
if result.User[0].Status >= 100 {
Expand All @@ -133,7 +133,7 @@ func MailVerify(c *gin.Context) {
MailVerify: &[]bool{true}[0]}); err != nil {
c.JSON(http.StatusInternalServerError, common.Error{Error: err.Error()})
} else {
c.JSON(http.StatusOK, &user.Result{})
c.JSON(http.StatusOK, &common.Result{Result: "OK"})
}
}

Expand Down

0 comments on commit a2de50a

Please sign in to comment.