fix api get all closing; fix get closing sapronak; fix get all maste data product

This commit is contained in:
MacBook Air M1
2025-12-30 14:42:53 +07:00
parent ddda696454
commit 0285852c42
4 changed files with 131 additions and 49 deletions
@@ -70,6 +70,7 @@ func (s productService) GetAll(c *fiber.Ctx, params *validation.Query) ([]entity
products, total, err := s.Repository.GetAll(c.Context(), offset, params.Limit, func(db *gorm.DB) *gorm.DB {
db = s.withRelations(db)
db = db.Where("is_visible = ?", true)
if params.Search != "" {
return db.Where("name LIKE ?", "%"+params.Search+"%")
}