feat/trx-orders: added includes on prescription
This commit is contained in:
@@ -34,8 +34,9 @@ type FilterDto struct {
|
||||
Status_Code *erc.DataStatusCode `json:"status-code"`
|
||||
}
|
||||
type ReadDetailDto struct {
|
||||
Id uint `json:"id"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Id uint `json:"id"`
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Includes string `json:"includes"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
|
||||
@@ -89,7 +89,7 @@ func ReadDetailData(input e.ReadDetailDto, event *pl.Event, dbx ...*gorm.DB) (*e
|
||||
tx = tx.Where("\"Id\" = ?", input.Id)
|
||||
}
|
||||
|
||||
if err := tx.First(&data).Error; err != nil {
|
||||
if err := tx.Scopes(gh.Preload(input.Includes)).First(&data).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