🐛 Fix api path
This commit is contained in:
parent
c185fde553
commit
0132b91394
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
/uploads
|
||||
/dist
|
||||
/keys
|
||||
|
||||
.DS_Store
|
||||
|
@ -9,11 +9,11 @@ func MapAPIs(app *fiber.App, baseURL string) {
|
||||
{
|
||||
publishers := api.Group("/publishers").Name("Publisher API")
|
||||
{
|
||||
publishers.Get("/", listOwnedPublisher)
|
||||
publishers.Post("/personal", createPersonalPublisher)
|
||||
publishers.Post("/organization", createOrganizationPublisher)
|
||||
publishers.Get("/:name/pins", listPinnedPost)
|
||||
publishers.Get("/:name", getPublisher)
|
||||
publishers.Get("/owned", listOwnedPublisher)
|
||||
publishers.Post("/:name/personal", createPersonalPublisher)
|
||||
publishers.Post("/:name/organization", createOrganizationPublisher)
|
||||
publishers.Put("/:publisherId", editPublisher)
|
||||
publishers.Delete("/:publisherId", deletePublisher)
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ func listOwnedPublisher(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func createPersonalPublisher(c *fiber.Ctx) error {
|
||||
if err := sec.EnsureGrantedPerm(c, "CreatePublisher", true); err != nil {
|
||||
if err := sec.EnsureGrantedPerm(c, "CreatePublishers", true); err != nil {
|
||||
return err
|
||||
}
|
||||
user := c.Locals("user").(authm.Account)
|
||||
@ -71,7 +71,7 @@ func createPersonalPublisher(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func createOrganizationPublisher(c *fiber.Ctx) error {
|
||||
if err := sec.EnsureGrantedPerm(c, "CreatePublisher", true); err != nil {
|
||||
if err := sec.EnsureGrantedPerm(c, "CreatePublishers", true); err != nil {
|
||||
return err
|
||||
}
|
||||
user := c.Locals("user").(authm.Account)
|
||||
|
Loading…
Reference in New Issue
Block a user