adjust query daily checklist

This commit is contained in:
giovanni
2026-03-09 12:59:11 +07:00
parent fc532e1202
commit b93150e8df
4 changed files with 23 additions and 21 deletions
@@ -75,7 +75,7 @@ type DailyChecklistListItem struct {
RejectReason *string
CreatedAt time.Time
UpdatedAt time.Time
Kandang entity.Kandang
Kandang entity.KandangGroup
TotalPhase int
TotalActivity int
Progress int
@@ -341,9 +341,9 @@ func (s dailyChecklistService) GetAll(c *fiber.Ctx, params *validation.Query) ([
}
}
kandangMap := make(map[uint]entity.Kandang)
kandangMap := make(map[uint]entity.KandangGroup)
if len(kandangIDs) > 0 {
var kandangs []entity.Kandang
var kandangs []entity.KandangGroup
if err := s.Repository.DB().WithContext(c.Context()).
Where("id IN ?", kandangIDs).
Preload("Location").