update category

This commit is contained in:
Anang Yusman 2026-02-03 19:10:10 +08:00
parent 99aa77e60a
commit 0f46937b14
1 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,7 @@ type GalleriesCreateRequest struct {
Title string `json:"title" validate:"required"`
Description *string `json:"description"`
ThumbnailPath *string `json:"thumbnail_path"`
Category string `form:"category" json:"category" validate:"required"`
Category string `json:"category" validate:"required"`
}
@ -42,6 +42,7 @@ func (req GalleriesCreateRequest) ToEntity() *entity.Galleries {
Title: req.Title,
Description: req.Description,
ThumbnailPath: req.ThumbnailPath,
Category: req.Category,
}
}
@ -49,7 +50,7 @@ type GalleriesUpdateRequest struct {
Title *string `json:"title"`
Description *string `json:"description"`
ThumbnailPath *string `json:"thumbnail_path"`
Category string `form:"category" json:"category" validate:"required"`
Category string `json:"category" validate:"required"`
IsActive *bool `json:"is_active"`
}
@ -60,6 +61,7 @@ func (req GalleriesUpdateRequest) ToEntity() *entity.Galleries {
Title: getStringValue(req.Title),
Description: req.Description,
ThumbnailPath: req.ThumbnailPath,
Category: req.Category,
IsActive: req.IsActive,
}
}