Claim fixes
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2023-03-07 10:20:10 +01:00
parent 44e7abd6d3
commit 445a0b0e1f
2 changed files with 15 additions and 15 deletions

View File

@ -29,21 +29,21 @@ module.exports = Self => {
myOptions.transaction = ctx.options.transaction;
const claimBeginning = await Self.findById(ctx.where.id);
const filter = {
where: {id: claimBeginning.claimFk},
include: [
{
relation: 'claimState',
scope: {
fields: ['id', 'code', 'description']
}
}
]
};
where: {id: claimBeginning.claimFk},
include: [
{
relation: 'claimState',
scope: {
fields: ['id', 'code', 'description']
}
}
]
};
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)
throw new UserError(`The current claim can't be modified`);

View File

@ -100,8 +100,8 @@ class Controller extends Section {
}
setClaimedQuantity(id, claimedQuantity) {
let params = {id: id, quantity: claimedQuantity};
let query = `ClaimBeginnings/`;
let params = {quantity: claimedQuantity};
let query = `ClaimBeginnings/${id}`;
this.$http.patch(query, params).then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
this.calculateTotals();