fix request changes
This commit is contained in:
parent
4561b6eeef
commit
63cd436d3c
|
@ -31,7 +31,7 @@ describe('ticket isEditable()', () => {
|
||||||
expect(result).toEqual(true);
|
expect(result).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not be able to edit a deleted or invoiced ticket if the role is salesAssistantº', async() => {
|
it('should not be able to edit a deleted or invoiced ticket if the role is salesAssistant', async() => {
|
||||||
let ctx = {req: {accessToken: {userId: 21}}};
|
let ctx = {req: {accessToken: {userId: 21}}};
|
||||||
let result = await app.models.Ticket.isEditable(ctx, 19);
|
let result = await app.models.Ticket.isEditable(ctx, 19);
|
||||||
|
|
||||||
|
|
|
@ -69,10 +69,6 @@ module.exports = Self => {
|
||||||
if (!allFromSameTicket)
|
if (!allFromSameTicket)
|
||||||
throw new UserError('All sales must belong to the same ticket');
|
throw new UserError('All sales must belong to the same ticket');
|
||||||
|
|
||||||
// const isEditable = await models.Ticket.isEditable(ctx, id);
|
|
||||||
// if (!isEditable)
|
|
||||||
// throw new UserError(`The sales of this ticket can't be modified`);
|
|
||||||
|
|
||||||
const isLocked = await models.Ticket.isLocked(id);
|
const isLocked = await models.Ticket.isLocked(id);
|
||||||
const isSalesPerson = await models.Account.hasRole(userId, 'salesPerson');
|
const isSalesPerson = await models.Account.hasRole(userId, 'salesPerson');
|
||||||
const state = await Self.app.models.TicketState.findOne({
|
const state = await Self.app.models.TicketState.findOne({
|
||||||
|
|
Loading…
Reference in New Issue