refs #5976 refactor: transaferSale call setDeleted
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
0d308ec8ad
commit
15dee8bef4
|
@ -0,0 +1,6 @@
|
|||
UPDATE `salix`.`ACL`
|
||||
SET principalId='salesperson'
|
||||
WHERE
|
||||
model='Ticket'
|
||||
AND property='setDeleted'
|
||||
AND accessType='WRITE';
|
|
@ -5,6 +5,8 @@ describe('sale transferSales()', () => {
|
|||
const userId = 1101;
|
||||
const activeCtx = {
|
||||
accessToken: {userId: userId},
|
||||
headers: {origin: ''},
|
||||
__: value => value
|
||||
};
|
||||
const ctx = {req: activeCtx};
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue