revised lib and usecase update

This commit is contained in:
vanilia
2025-10-14 13:35:48 +07:00
parent fce7cfaf7b
commit 1b1f641c2c
5 changed files with 9 additions and 14 deletions
@@ -81,10 +81,8 @@ func ReadDetailData(input eir.ReadDetailDto, event *pl.Event, dbx ...*gorm.DB) (
tx = dg.I
}
preload := "encounter,unit,doctor"
if err := tx.
Scopes(gh.Preload(preload)).
Scopes(gh.Preload(input.Includes)).
First(&data, input.Id).
Error; err != nil {
@@ -99,7 +97,8 @@ func ReadDetailData(input eir.ReadDetailDto, event *pl.Event, dbx ...*gorm.DB) (
func UpdateData(input eir.UpdateDto, data *eir.InternalReference, event *pl.Event, dbx ...*gorm.DB) error {
pl.SetLogInfo(event, data, "started", "DBUpdate")
data = setDataUpdate(input, data)
setData(&input, data)
//data = setDataUpdate(input, data)
var tx *gorm.DB
if len(dbx) > 0 {