feat(BE): refactor search queries to be case insensitive across all modules

This commit is contained in:
aguhh18
2026-01-11 21:09:15 +07:00
parent d3c7d65bf5
commit 28c6aaefac
23 changed files with 31 additions and 28 deletions
@@ -51,7 +51,7 @@ func (s phasesService) GetAll(c *fiber.Ctx, params *validation.Query) ([]entity.
phasess, total, err := s.Repository.GetAll(c.Context(), offset, params.Limit, func(db *gorm.DB) *gorm.DB {
db = s.withRelations(db)
if params.Search != "" {
return db.Where("name LIKE ?", "%"+params.Search+"%")
return db.Where("LOWER(name) LIKE LOWER(?)", "%"+params.Search+"%")
}
if params.Category != nil {
db = db.Where("category = ?", *params.Category)