feat (infra): add preload for get detail
This commit is contained in:
@@ -104,6 +104,14 @@ func ReadDetailData(input e.ReadDetailDto, event *pl.Event, dbx ...*gorm.DB) (*e
|
||||
tx = dg.I
|
||||
}
|
||||
|
||||
tx = tx.Preload("Parent").
|
||||
Preload("Childrens").
|
||||
Preload("Item").
|
||||
Preload("Rooms").
|
||||
Preload("Rooms.Specialist").
|
||||
Preload("Rooms.Subspecialist").
|
||||
Preload("Rooms.Unit")
|
||||
|
||||
if err := tx.First(&data, input.Id).Error; err != nil {
|
||||
if processedErr := pu.HandleReadError(err, event, source, input.Id, data); processedErr != nil {
|
||||
return nil, processedErr
|
||||
|
||||
Reference in New Issue
Block a user