微调了事务提交时的处理顺序
This commit is contained in:
parent
a86981512d
commit
a44173cab6
|
|
@ -159,10 +159,11 @@ class AppLoader extends types_1.AppLoader {
|
|||
await context.begin();
|
||||
try {
|
||||
const result = await fn(params, context);
|
||||
await context.commit();
|
||||
await context.refineOpRecords();
|
||||
const { opRecords } = context;
|
||||
await context.commit();
|
||||
return {
|
||||
opRecords: context.opRecords.map(ele => (0, lodash_1.omit)(ele, 'id')),
|
||||
opRecords: opRecords.map(ele => (0, lodash_1.omit)(ele, 'id')),
|
||||
message: context.getMessage(),
|
||||
result,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -215,10 +215,11 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Backe
|
|||
await context.begin();
|
||||
try {
|
||||
const result = await fn(params, context);
|
||||
await context.commit();
|
||||
await context.refineOpRecords();
|
||||
const { opRecords } = context;
|
||||
await context.commit();
|
||||
return {
|
||||
opRecords: (context.opRecords as CreateOpResult<ED, keyof ED>[]).map(ele => omit(ele, 'id')),
|
||||
opRecords: (opRecords as CreateOpResult<ED, keyof ED>[]).map(ele => omit(ele, 'id')),
|
||||
message: context.getMessage(),
|
||||
result,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue