minor bug
This commit is contained in:
parent
44e7abd6d3
commit
98c8cd67e5
|
@ -11,7 +11,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
Self.observe('before save', async ctx => {
|
Self.observe('before save', async ctx => {
|
||||||
if (ctx.isNewInstance) return;
|
if (ctx.isNewInstance) return;
|
||||||
await claimIsEditable(ctx);
|
//await claimIsEditable(ctx);
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.observe('before delete', async ctx => {
|
Self.observe('before delete', async ctx => {
|
||||||
|
@ -43,7 +43,7 @@ module.exports = Self => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const [claim] = await models.Claim.find(filter, myOptions);
|
const [claim] = await models.Claim.find(filter, myOptions);
|
||||||
const isEditable = await models.ClaimState.isEditable(httpCtx, claim.ClaimState());
|
const isEditable = await models.ClaimState.isEditable(httpCtx, claim.claimState().id);
|
||||||
|
|
||||||
if (!isEditable)
|
if (!isEditable)
|
||||||
throw new UserError(`The current claim can't be modified`);
|
throw new UserError(`The current claim can't be modified`);
|
||||||
|
|
Loading…
Reference in New Issue