mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
API: Update endpoints to return HTTP 201 when a new resource was created
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -30,7 +30,7 @@ import (
|
||||
// @Produce json
|
||||
// @Param uid path string true "user uid"
|
||||
// @Param request body form.Passcode true "passcode setup (password required)"
|
||||
// @Success 200 {object} entity.Passcode
|
||||
// @Success 201 {object} entity.Passcode
|
||||
// @Failure 400,401,403,429 {object} i18n.Response
|
||||
// @Router /api/v1/users/{uid}/passcode [post]
|
||||
func CreateUserPasscode(router *gin.RouterGroup) {
|
||||
@@ -84,7 +84,8 @@ func CreateUserPasscode(router *gin.RouterGroup) {
|
||||
|
||||
event.AuditInfo([]string{ClientIP(c), "session %s", authn.Users, user.UserName, authn.Passcode, authn.Created}, s.RefID)
|
||||
|
||||
c.JSON(http.StatusOK, passcode)
|
||||
header.SetLocation(c)
|
||||
c.JSON(http.StatusCreated, passcode)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user