@cuboapp/api-backend 3.0.5 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/index.ts +8 -11
package/package.json
CHANGED
package/src/core/index.ts
CHANGED
|
@@ -529,14 +529,7 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown =
|
|
|
529
529
|
if (this.options.hooks?.onAfterUpdate && !this.excluded(opts, 'baseHooks')) {
|
|
530
530
|
await this.options.hooks.onAfterUpdate(entity, row, prevById.get((row as any).id) as T[K], opts)
|
|
531
531
|
}
|
|
532
|
-
this.crdtPush(
|
|
533
|
-
'update',
|
|
534
|
-
entity,
|
|
535
|
-
row,
|
|
536
|
-
opts,
|
|
537
|
-
prevById.get((row as any).id),
|
|
538
|
-
Object.keys(dto)
|
|
539
|
-
)
|
|
532
|
+
this.crdtPush('update', entity, row, opts, prevById.get((row as any).id), Object.keys(dto))
|
|
540
533
|
}
|
|
541
534
|
|
|
542
535
|
return updated
|
|
@@ -643,7 +636,9 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown =
|
|
|
643
636
|
}
|
|
644
637
|
|
|
645
638
|
/**
|
|
646
|
-
* Опции для внутренних read-back'ов: без наследования queryOptions
|
|
639
|
+
* Опции для внутренних read-back'ов: без наследования queryOptions фильтрации.
|
|
640
|
+
* Служебный extra сохраняется, чтобы augmentation-хуки могли отличить
|
|
641
|
+
* внутреннюю серверную операцию от пользовательского запроса.
|
|
647
642
|
* getOne-хуки чтения (beforeGetOne/afterGetOne) ВКЛЮЧЕНЫ — они должны срабатывать
|
|
648
643
|
* на select/re-select внутри createOne/updateOne/deleteOne (запись+read-back идут
|
|
649
644
|
* в одной транзакции, поэтому «спрятавший» строку beforeGetOne откатит запись).
|
|
@@ -655,7 +650,8 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown =
|
|
|
655
650
|
performer_id: opts.performer_id,
|
|
656
651
|
auth: opts.auth,
|
|
657
652
|
log: opts.log,
|
|
658
|
-
|
|
653
|
+
queryOptions: { extra: opts.queryOptions?.extra },
|
|
654
|
+
excludeHooks: [...new Set<CuboHookName>([...(opts.excludeHooks || []), 'beforeGetMany', 'afterGetMany'])]
|
|
659
655
|
}
|
|
660
656
|
}
|
|
661
657
|
|
|
@@ -670,7 +666,8 @@ export class CuboBackendApi<T extends CuboApiEntitiesMap<T>, A extends unknown =
|
|
|
670
666
|
req,
|
|
671
667
|
auth: opts.auth as A,
|
|
672
668
|
performer_id: opts.performer_id,
|
|
673
|
-
queryOptions
|
|
669
|
+
queryOptions,
|
|
670
|
+
transaction: opts?.transaction
|
|
674
671
|
}
|
|
675
672
|
}
|
|
676
673
|
|