1
0

Add /user endpoint (#1)

This commit is contained in:
JonasFranz
2018-09-17 16:25:05 +00:00
committed by Gitea
parent 42bd69321a
commit 26d37bbedf
3 changed files with 16 additions and 25 deletions

View File

@ -58,11 +58,11 @@ func userAddOrUpdate(c echo.Context) error {
}
// Check if the user exists
var exists bool
var exists = true
_, err := models.GetUserByID(datUser.ID)
if err != nil {
if models.IsErrUserDoesNotExist(err) {
exists = true
exists = false
} else {
return c.JSON(http.StatusInternalServerError, models.Message{"Could not check if the user exists."})
}