feat: update bug fixing articles

This commit is contained in:
hanif salafi 2025-07-03 13:28:32 +07:00
parent 906626931d
commit 9455bdb932
5 changed files with 26 additions and 8 deletions

View File

@ -162,7 +162,8 @@ func (_i *articlesController) ShowByOldId(c *fiber.Ctx) error {
// @Description API for create Articles
// @Tags Articles
// @Security Bearer
// @Param X-Csrf-Token header string true "Insert the X-Csrf-Token"
// @Param X-Client-Key header string false "Insert the X-Client-Key"
// @Param X-Csrf-Token header string false "Insert the X-Csrf-Token"
// @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>)
// @Param payload body request.ArticlesCreateRequest true "Required payload"
// @Success 200 {object} response.Response

View File

@ -156,13 +156,17 @@ func (_i *articlesService) Save(clientId *uuid.UUID, req request.ArticlesCreateR
}
newReq.CreatedById = &createdBy.ID
userLevelNumber = createdBy.UserLevel.LevelNumber
if createdBy.UserLevel.ParentLevelId != nil {
userParentLevelId = *createdBy.UserLevel.ParentLevelId
}
} else {
createdBy := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
newReq.CreatedById = &createdBy.ID
userLevelNumber = createdBy.UserLevel.LevelNumber
if createdBy.UserLevel.ParentLevelId != nil {
userParentLevelId = *createdBy.UserLevel.ParentLevelId
}
}
isDraft := true
if req.IsDraft == &isDraft {

View File

@ -3479,12 +3479,17 @@ const docTemplate = `{
],
"summary": "Create Articles",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header"
},
{
"type": "string",
"description": "Insert the X-Csrf-Token",
"name": "X-Csrf-Token",
"in": "header",
"required": true
"in": "header"
},
{
"type": "string",

View File

@ -3468,12 +3468,17 @@
],
"summary": "Create Articles",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header"
},
{
"type": "string",
"description": "Insert the X-Csrf-Token",
"name": "X-Csrf-Token",
"in": "header",
"required": true
"in": "header"
},
{
"type": "string",

View File

@ -3163,10 +3163,13 @@ paths:
post:
description: API for create Articles
parameters:
- description: Insert the X-Client-Key
in: header
name: X-Client-Key
type: string
- description: Insert the X-Csrf-Token
in: header
name: X-Csrf-Token
required: true
type: string
- default: Bearer <Add access token here>
description: Insert your access token