diff --git a/.gitignore b/.gitignore index b9bcb4e..cd42558 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /uploads /dist +/keys .DS_Store diff --git a/pkg/internal/http/api/index.go b/pkg/internal/http/api/index.go index 3cfa863..9066fb6 100644 --- a/pkg/internal/http/api/index.go +++ b/pkg/internal/http/api/index.go @@ -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) } diff --git a/pkg/internal/http/api/publishers_api.go b/pkg/internal/http/api/publishers_api.go index badc896..7cdfaa6 100644 --- a/pkg/internal/http/api/publishers_api.go +++ b/pkg/internal/http/api/publishers_api.go @@ -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)