refs #5976 refactor: transaferSale call setDeleted
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-07-17 15:19:36 +02:00
parent 0d308ec8ad
commit 15dee8bef4
3 changed files with 10 additions and 5 deletions

View File

@ -0,0 +1,6 @@
UPDATE `salix`.`ACL`
SET principalId='salesperson'
WHERE
model='Ticket'
AND property='setDeleted'
AND accessType='WRITE';

View File

@ -5,6 +5,8 @@ describe('sale transferSales()', () => {
const userId = 1101;
const activeCtx = {
accessToken: {userId: userId},
headers: {origin: ''},
__: value => value
};
const ctx = {req: activeCtx};

View File

@ -96,11 +96,8 @@ module.exports = Self => {
}
const isTicketEmpty = await models.Ticket.isEmpty(id, myOptions);
if (isTicketEmpty) {
await originalTicket.updateAttributes({
isDeleted: true
}, myOptions);
}
if (isTicketEmpty)
await models.Ticket.setDeleted(ctx, id, myOptions);
if (tx) await tx.commit();