From c2447e619fb666989c8500910dc49e89c2099ca7 Mon Sep 17 00:00:00 2001 From: hanif salafi Date: Mon, 7 Apr 2025 09:54:28 +0700 Subject: [PATCH] feat: update articles --- .gitignore | 3 ++- .../advertisement/controller/advertisement.controller.go | 4 ++-- app/module/articles/controller/articles.controller.go | 4 ++-- docs/swagger/docs.go | 4 ++-- docs/swagger/swagger.json | 4 ++-- docs/swagger/swagger.yaml | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 6da83fd..7abf38c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /vendor -debug.log \ No newline at end of file +debug.log +.idea \ No newline at end of file diff --git a/app/module/advertisement/controller/advertisement.controller.go b/app/module/advertisement/controller/advertisement.controller.go index 8a7e2c2..cb32b3f 100644 --- a/app/module/advertisement/controller/advertisement.controller.go +++ b/app/module/advertisement/controller/advertisement.controller.go @@ -205,7 +205,7 @@ func (_i *advertisementController) Update(c *fiber.Ctx) error { // @Tags Advertisement // @Security Bearer // @Param id path int true "Advertisement ID" -// @Param isPublish path bool true "Advertisement Publish Status" +// @Param isPublish query bool true "Advertisement Publish Status" // @Success 200 {object} response.Response // @Failure 400 {object} response.BadRequestError // @Failure 401 {object} response.UnauthorizedError @@ -217,7 +217,7 @@ func (_i *advertisementController) UpdatePublish(c *fiber.Ctx) error { return err } - isPublish, err := strconv.ParseBool(c.Params("isPublish")) + isPublish, err := strconv.ParseBool(c.Query("isPublish")) if err != nil { return err } diff --git a/app/module/articles/controller/articles.controller.go b/app/module/articles/controller/articles.controller.go index 1d70787..838e478 100644 --- a/app/module/articles/controller/articles.controller.go +++ b/app/module/articles/controller/articles.controller.go @@ -207,7 +207,7 @@ func (_i *articlesController) Update(c *fiber.Ctx) error { // @Tags Articles // @Security Bearer // @Param id path int true "Articles ID" -// @Param isBanner path bool true "Articles Banner Status" +// @Param isBanner query bool true "Articles Banner Status" // @Success 200 {object} response.Response // @Failure 400 {object} response.BadRequestError // @Failure 401 {object} response.UnauthorizedError @@ -219,7 +219,7 @@ func (_i *articlesController) UpdateBanner(c *fiber.Ctx) error { return err } - isBanner, err := strconv.ParseBool(c.Params("isBanner")) + isBanner, err := strconv.ParseBool(c.Query("isBanner")) if err != nil { return err } diff --git a/docs/swagger/docs.go b/docs/swagger/docs.go index 778cb3a..a81505a 100644 --- a/docs/swagger/docs.go +++ b/docs/swagger/docs.go @@ -518,7 +518,7 @@ const docTemplate = `{ "type": "boolean", "description": "Advertisement Publish Status", "name": "isPublish", - "in": "path", + "in": "query", "required": true } ], @@ -3287,7 +3287,7 @@ const docTemplate = `{ "type": "boolean", "description": "Articles Banner Status", "name": "isBanner", - "in": "path", + "in": "query", "required": true } ], diff --git a/docs/swagger/swagger.json b/docs/swagger/swagger.json index cc0db49..f456ab8 100644 --- a/docs/swagger/swagger.json +++ b/docs/swagger/swagger.json @@ -507,7 +507,7 @@ "type": "boolean", "description": "Advertisement Publish Status", "name": "isPublish", - "in": "path", + "in": "query", "required": true } ], @@ -3276,7 +3276,7 @@ "type": "boolean", "description": "Articles Banner Status", "name": "isBanner", - "in": "path", + "in": "query", "required": true } ], diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml index 5517245..56f96d1 100644 --- a/docs/swagger/swagger.yaml +++ b/docs/swagger/swagger.yaml @@ -1327,7 +1327,7 @@ paths: required: true type: integer - description: Advertisement Publish Status - in: path + in: query name: isPublish required: true type: boolean @@ -3074,7 +3074,7 @@ paths: required: true type: integer - description: Articles Banner Status - in: path + in: query name: isBanner required: true type: boolean