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 userId = 1101;
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: userId},
|
accessToken: {userId: userId},
|
||||||
|
headers: {origin: ''},
|
||||||
|
__: value => value
|
||||||
};
|
};
|
||||||
const ctx = {req: activeCtx};
|
const ctx = {req: activeCtx};
|
||||||
|
|
||||||
|
|
|
@ -96,11 +96,8 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const isTicketEmpty = await models.Ticket.isEmpty(id, myOptions);
|
const isTicketEmpty = await models.Ticket.isEmpty(id, myOptions);
|
||||||
if (isTicketEmpty) {
|
if (isTicketEmpty)
|
||||||
await originalTicket.updateAttributes({
|
await models.Ticket.setDeleted(ctx, id, myOptions);
|
||||||
isDeleted: true
|
|
||||||
}, myOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue