refactor(endpoints): corrected indentation and removed unused code
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-10-15 16:00:50 +02:00
parent de7af0fee2
commit c4c1aa929a
7 changed files with 6 additions and 3 deletions

View File

@ -89,6 +89,7 @@ module.exports = Self => {
await uploadNewFile(ctx, dms, myOptions);
if (tx) await tx.commit();
return dms;
} catch (e) {
if (tx) await tx.rollback();

View File

@ -96,6 +96,7 @@ module.exports = Self => {
}
if (tx) await tx.commit();
return addedDms;
} catch (e) {
if (tx) await tx.rollback();

View File

@ -151,6 +151,7 @@ module.exports = Self => {
await fs.unlink(srcFilePath);
await tx.commit();
return newImage;
} catch (e) {
await tx.rollback();

View File

@ -41,6 +41,7 @@ module.exports = Self => {
const deleted = await Promise.all(promises);
if (tx) await tx.commit();
return deleted;
} catch (e) {
if (tx) await tx.rollback();

View File

@ -97,6 +97,7 @@ module.exports = Self => {
const sql = ParameterizedSQL.join(stmts, ';');
await conn.executeStmt(sql, myOptions);
if (tx) await tx.commit();
} catch (e) {
if (tx) await tx.rollback();

View File

@ -117,9 +117,6 @@ module.exports = Self => {
if (!zoneShipped || zoneShipped.zoneFk != args.zoneFk)
throw new UserError(`You don't have privileges to change the zone`);
}
const observationTypeDelivery = await models.ObservationType.findOne({
where: {code: 'delivery'}
}, myOptions);
const originalTicket = await models.Ticket.findOne({
where: {id: args.id},

View File

@ -70,6 +70,7 @@ module.exports = Self => {
await models.ZoneIncluded.create(newIncludedGeo, myOptions);
await models.ZoneEvent.create(newCalendarDays, myOptions);
if (tx) await tx.commit();
return newZone;