Locations added
This commit is contained in:
30
backend/api/locations_routes.go
Normal file
30
backend/api/locations_routes.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fr.latosa-escrima/api/locations"
|
||||
"fr.latosa-escrima/core"
|
||||
)
|
||||
|
||||
var LocationsRoutes = map[string]core.Handler{
|
||||
"GET /locations/all": {
|
||||
Handler: locations.HandleLocations,
|
||||
Middlewares: []core.Middleware{Methods("GET")},
|
||||
},
|
||||
"/locations/new": {
|
||||
Handler: locations.HandleNew,
|
||||
Middlewares: []core.Middleware{Methods(("POST")),
|
||||
HasPermissions("locations", "insert"), AuthJWT}},
|
||||
"GET /locations": {
|
||||
Handler: locations.HandleLocation,
|
||||
Middlewares: []core.Middleware{Methods("GET")}},
|
||||
"DELETE /locations": {
|
||||
Handler: locations.HandleDelete,
|
||||
Middlewares: []core.Middleware{Methods("DELETE"),
|
||||
HasPermissions("locations", "delete"), AuthJWT},
|
||||
},
|
||||
"PATCH /locations": {
|
||||
Handler: locations.HandleUpdate,
|
||||
Middlewares: []core.Middleware{Methods("PATCH"),
|
||||
HasPermissions("blogs", "update"), AuthJWT},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user