feat (user): add block and active

This commit is contained in:
dpurbosakti
2025-08-25 09:57:55 +07:00
parent 4d10a8f99f
commit d10b92c7b1
3 changed files with 131 additions and 5 deletions
@@ -54,7 +54,15 @@ func SetRoutes() http.Handler {
// r.HandleFunc("POST /v1/authentication/logout", auth.Logout)
hk.Route("POST /v1/authentication/logout", r, auth.GuardMW, auth.Logout)
hc.RegCrud(r, "/v1/user", user.O)
hk.GroupRoutes("/v1/user", r, hk.MapHandlerFunc{
"GET /": user.O.GetList,
"GET /{id}": user.O.GetDetail,
"POST /": user.O.Create,
"PATCH /{id}": user.O.Update,
"DELETE /{id}": user.O.Delete,
"PATCH /{id}/block": user.O.Block,
"PATCH /{id}/active": user.O.Active,
})
/******************** sources ********************/
hc.RegCrud(r, "/v1/division", division.O)