refs #5929 removed useless vars
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Jorge Penadés 2023-07-26 09:20:54 +02:00
parent 0b6fb70f28
commit a0fee6ad50
8 changed files with 8 additions and 12 deletions

View File

@ -46,7 +46,7 @@ module.exports = Self => {
}
try {
const isEditable = await models.Ticket.isEditableOrThrow(ctx, id, myOptions);
await models.Ticket.isEditableOrThrow(ctx, id, myOptions);
const item = await models.Item.findById(itemId, null, myOptions);
const ticket = await models.Ticket.findById(id, {

View File

@ -115,7 +115,7 @@ module.exports = Self => {
const userId = ctx.req.accessToken.userId;
const models = Self.app.models;
const $t = ctx.req.__; // $translate
const isEditable = await models.Ticket.isEditableOrThrow(ctx, args.id, myOptions);
await models.Ticket.isEditableOrThrow(ctx, args.id, myOptions);
const editZone = await models.ACL.checkAccessAcl(ctx, 'Ticket', 'editZone', 'WRITE');
if (!editZone) {

View File

@ -70,7 +70,7 @@ module.exports = Self => {
}
try {
const isEditable = await Self.isEditableOrThrow(ctx, args.id, myOptions);
await Self.isEditableOrThrow(ctx, args.id, myOptions);
const editZone = await models.ACL.checkAccessAcl(ctx, 'Ticket', 'editZone', 'WRITE');
if (!editZone) {

View File

@ -32,7 +32,7 @@ module.exports = Self => {
}
try {
const isEditable = await Self.isEditableOrThrow(ctx, id, myOptions);
await Self.isEditableOrThrow(ctx, id, myOptions);
const recalculation = await Self.rawSql('CALL vn.ticket_recalcComponents(?, NULL)', [id], myOptions);

View File

@ -39,7 +39,7 @@ module.exports = Self => {
const ticketToDelete = await models.Ticket.findById(id, {fields: ['isDeleted']}, myOptions);
if (ticketToDelete.isDeleted) return false;
const isEditable = await Self.isEditableOrThrow(ctx, id, myOptions);
await Self.isEditableOrThrow(ctx, id, myOptions);
// Check if ticket has refunds
const ticketRefunds = await models.TicketRefund.find({

View File

@ -65,13 +65,9 @@ describe('ticket isEditableOrThrow()', () => {
let error;
try {
const options = {transaction: tx};
const ctx = {req: {accessToken: {userId: 1}}};
const result = await models.Ticket.isEditableOrThrow(ctx, 15, options);
expect(result).toEqual(false);
await models.Ticket.isEditableOrThrow(ctx, 15, options);
await tx.rollback();
} catch (e) {
error = e;

View File

@ -28,7 +28,7 @@ module.exports = Self => {
if (typeof options == 'object')
Object.assign(myOptions, options);
const isEditable = await Self.isEditableOrThrow(ctx, id, myOptions);
await Self.isEditableOrThrow(ctx, id, myOptions);
const ticket = await models.Ticket.findById(
id,

View File

@ -48,7 +48,7 @@ module.exports = Self => {
}
try {
const isEditable = await models.Ticket.isEditableOrThrow(ctx, id, myOptions);
await models.Ticket.isEditableOrThrow(ctx, id, myOptions);
if (ticketId) {
const isReceiverEditable = await models.Ticket.isEditable(ctx, ticketId, myOptions);