💥 Unified the publisher api

This commit is contained in:
2024-11-09 00:47:19 +08:00
parent f9a01bff70
commit 615fe3ff6c
4 changed files with 19 additions and 12 deletions

View File

@@ -109,8 +109,8 @@ func editPublisher(c *fiber.Ctx) error {
}
user := c.Locals("user").(authm.Account)
id, _ := c.ParamsInt("publisherId", 0)
publisher, err := services.GetPublisher(uint(id), user.ID)
name := c.Params("name")
publisher, err := services.GetPublisherByName(name, user.ID)
if err != nil {
return fiber.NewError(fiber.StatusNotFound, err.Error())
}
@@ -150,8 +150,8 @@ func deletePublisher(c *fiber.Ctx) error {
}
user := c.Locals("user").(authm.Account)
id, _ := c.ParamsInt("publisherId", 0)
publisher, err := services.GetPublisher(uint(id), user.ID)
name := c.Params("name")
publisher, err := services.GetPublisherByName(name, user.ID)
if err != nil {
return fiber.NewError(fiber.StatusNotFound, err.Error())
}