fix (specialist): fix read detail data

This commit is contained in:
dpurbosakti
2025-11-06 16:09:20 +07:00
parent b83e8971dc
commit 883249ab8c
@@ -81,9 +81,16 @@ func ReadDetailData(input e.ReadDetailDto, event *pl.Event, dbx ...*gorm.DB) (*e
tx = dg.I
}
if input.Code != nil {
tx = tx.Where("\"Code\" = ?", *input.Code)
}
if input.Id != nil {
tx = tx.Where("\"Id\" = ?", input.Id)
}
if err := tx.
Scopes(gh.Preload(input.Includes)).
First(&data, input.Id).Error; err != nil {
First(&data).Error; err != nil {
if processedErr := pu.HandleReadError(err, event, source, input.Id, data); processedErr != nil {
return nil, processedErr
}