feat: fixing article categories response

This commit is contained in:
hanif salafi 2024-05-09 00:51:08 +07:00
parent 7e9041d58b
commit 5dcaab799d
2 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package mapper
import (
"go-humas-be/app/database/entity"
res "go-humas-be/app/module/article_categories/response"
"strconv"
)
func ArticleCategoriesResponseMapper(articleCategoriesReq *entity.ArticleCategories) (articleCategoriesRes *res.ArticleCategoriesResponse) {
@ -12,6 +13,7 @@ func ArticleCategoriesResponseMapper(articleCategoriesReq *entity.ArticleCategor
Title: articleCategoriesReq.Title,
Description: articleCategoriesReq.Description,
ThumbnailPath: articleCategoriesReq.ThumbnailPath,
ThumbnailUrl: "/article-categories/thumbnail/viewer" + strconv.Itoa(int(articleCategoriesReq.ID)),
ParentId: articleCategoriesReq.ParentId,
CreatedById: articleCategoriesReq.CreatedById,
StatusId: articleCategoriesReq.StatusId,

View File

@ -7,7 +7,7 @@ type ArticleCategoriesResponse struct {
Title string `json:"title"`
Description string `json:"description"`
ThumbnailPath *string `json:"thumbnailPath"`
ThumbnailUrl *string `json:"thumbnailUrl"`
ThumbnailUrl string `json:"thumbnailUrl"`
ParentId *int `json:"parentId"`
CreatedById *uint `json:"createdById"`
StatusId int `json:"statusId"`