Mercurial > gemma
diff pkg/controllers/routes.go @ 5345:95dafb72a288 extented-report
Added a PATCH endpoint for /api/users/{user}
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 20 Jun 2021 04:17:53 +0200 |
parents | c008e13fa1d1 |
children | cb46f50ba168 |
line wrap: on
line diff
--- a/pkg/controllers/routes.go Fri Jun 18 21:27:41 2021 +0200 +++ b/pkg/controllers/routes.go Sun Jun 20 04:17:53 2021 +0200 @@ -68,6 +68,11 @@ Handle: updateUser, })).Methods(http.MethodPut) + api.Handle("/users/{user:.+}", any(&mw.JSONHandler{ + Input: func(*http.Request) interface{} { return new(models.UserPatch) }, + Handle: patchUser, + })).Methods(http.MethodPatch) + api.Handle("/users/{user:.+}", sysAdmin(&mw.JSONHandler{ Handle: deleteUser, })).Methods(http.MethodDelete)