mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-24 15:25:43 +00:00
FIX[BE]: delete redudant kandang response on projectflockkandang getone API
This commit is contained in:
@@ -28,7 +28,6 @@ type ProjectFlockCustomDTO struct {
|
||||
Category string `json:"category"`
|
||||
Fcr *fcrDTO.FcrBaseDTO `json:"fcr,omitempty"`
|
||||
Location *locationDTO.LocationBaseDTO `json:"location,omitempty"`
|
||||
Kandangs []KandangCustomDTO `json:"kandangs,omitempty"`
|
||||
CreatedUser *userDTO.UserBaseDTO `json:"created_user,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
@@ -85,7 +84,6 @@ func toProjectFlockCustomDTO(pf *projectFlockDTO.ProjectFlockListDTO) *ProjectFl
|
||||
Category: pf.Category,
|
||||
Fcr: pf.Fcr,
|
||||
Location: pf.Location,
|
||||
Kandangs: buildKandangCustomDTOs(pf.Kandangs),
|
||||
CreatedUser: pf.CreatedUser,
|
||||
CreatedAt: pf.CreatedAt,
|
||||
UpdatedAt: pf.UpdatedAt,
|
||||
@@ -238,18 +236,6 @@ func buildCreatedUser(pf entity.ProjectFlock) *userDTO.UserBaseDTO {
|
||||
return nil
|
||||
}
|
||||
|
||||
func buildKandangCustomDTOs(kandangs []projectFlockDTO.KandangWithProjectFlockIdDTO) []KandangCustomDTO {
|
||||
if len(kandangs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
result := make([]KandangCustomDTO, len(kandangs))
|
||||
for i, k := range kandangs {
|
||||
result[i] = toKandangCustomDTO(k)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func buildKandangFromEntity(kandang entity.Kandang) *KandangCustomDTO {
|
||||
if kandang.Id == 0 {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user