16 lines
427 B
Go
16 lines
427 B
Go
package main
|
|
|
|
import "github.com/go-chi/chi/v5"
|
|
|
|
func (a *app) registerEntitlementsRoutes(r chi.Router) {
|
|
r.Route("/entitlements", func(r chi.Router) {
|
|
r.Use(a.entitlementsAdminMiddleware)
|
|
r.Get("/", a.listEntitlements)
|
|
r.Post("/", a.createEntitlement)
|
|
r.Get("/{id}", a.getEntitlement)
|
|
r.Patch("/{id}", a.patchEntitlement)
|
|
r.Delete("/{id}", a.deleteEntitlement)
|
|
r.Post("/{id}/revoke", a.revokeEntitlement)
|
|
})
|
|
}
|