Modifies user/ endpoint:

Functions `addUser()`, `updateUser()` and `deleteUser()` now return
    a body of `{ "id": $userID }`.
This commit is contained in:
smavros 2019-08-15 14:34:35 +02:00
parent 1e4a2ee7cb
commit 8ce554b6d7

View file

@ -226,7 +226,7 @@ func addUser(c *gin.Context) {
}
c.JSON(http.StatusOK, gin.H{
"user": fmt.Sprintf(newUser.Username),
"id": newUser.ID,
})
}
@ -320,7 +320,7 @@ func updateUser(c *gin.Context) {
}
c.JSON(http.StatusOK, gin.H{
"user": fmt.Sprintf(updatedUser.Username),
"id": updatedUser.ID,
})
}
@ -393,5 +393,7 @@ func deleteUser(c *gin.Context) {
return
}
c.JSON(http.StatusOK, gin.H{})
c.JSON(http.StatusOK, gin.H{
"id": user.ID,
})
}