fix soapi sync
This commit is contained in:
@@ -51,7 +51,7 @@ func Create(input e.CreateDto) (*d.Data, error) {
|
||||
// get detail for sync
|
||||
soapiData, err := ReadDetailData(e.ReadDetailDto{
|
||||
Id: data.Id,
|
||||
Includes: "Encounter,Employee"}, &event)
|
||||
Includes: "Encounter,Employee"}, &event, tx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -59,7 +59,7 @@ func Create(input e.CreateDto) (*d.Data, error) {
|
||||
mwRunner.setMwType(pu.MWTPre)
|
||||
// Run pre-middleware
|
||||
if err = mwRunner.ExecuteIfSyncOn(func() error {
|
||||
return mwRunner.RunCreateMiddleware(createPostMw, soapiData)
|
||||
return mwRunner.RunCreateMiddleware(createPreMw, soapiData)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import plugin "simrs-vx/internal/use-case/simgos-sync-plugin/new/soapi"
|
||||
|
||||
func init() {
|
||||
createPreMw = append(createPreMw,
|
||||
createMw{Name: "sync-update-soapi", Func: plugin.Create})
|
||||
createMw{Name: "sync-create-soapi", Func: plugin.Create})
|
||||
|
||||
createSimxLogMw = append(createSimxLogMw,
|
||||
createLogMw{Name: "create-sync-log", Func: plugin.CreateLog})
|
||||
|
||||
Reference in New Issue
Block a user