feat[BE-127] add source and target project flock to transfer laying API

This commit is contained in:
aguhh18
2025-11-11 14:32:55 +07:00
parent 6b5d27ae8e
commit 762dfa9fb9
4 changed files with 94 additions and 18 deletions
@@ -85,7 +85,6 @@ func (s projectFlockKandangService) GetAll(c *fiber.Ctx, params *validation.Quer
}
}
// Fetch Flock master data for each ProjectFlockKandang
flockMap := make(map[uint]*flockDTO.FlockBaseDTO)
for i := range projectFlockKandangs {
if projectFlockKandangs[i].ProjectFlock.Id != 0 {
@@ -95,7 +94,7 @@ func (s projectFlockKandangService) GetAll(c *fiber.Ctx, params *validation.Quer
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
s.Log.Warnf("Failed to fetch flock %q: %+v", baseName, err)
} else if flock != nil {
// Convert to DTO and store in map with ProjectFlockId as key
flockMap[projectFlockKandangs[i].ProjectFlock.Id] = &flockDTO.FlockBaseDTO{
Id: flock.Id,
Name: flock.Name,