mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
Modifies user/ endpoint:
Functions `addUser()`, `updateUser()` and `deleteUser()` now return a body of `{ "id": $userID }`.
This commit is contained in:
parent
1e4a2ee7cb
commit
8ce554b6d7
1 changed files with 5 additions and 3 deletions
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue