refactor(endpoints): corrected indentation and removed unused code
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
de7af0fee2
commit
c4c1aa929a
|
@ -89,6 +89,7 @@ module.exports = Self => {
|
||||||
await uploadNewFile(ctx, dms, myOptions);
|
await uploadNewFile(ctx, dms, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
return dms;
|
return dms;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (tx) await tx.rollback();
|
if (tx) await tx.rollback();
|
||||||
|
|
|
@ -96,6 +96,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
return addedDms;
|
return addedDms;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (tx) await tx.rollback();
|
if (tx) await tx.rollback();
|
||||||
|
|
|
@ -151,6 +151,7 @@ module.exports = Self => {
|
||||||
await fs.unlink(srcFilePath);
|
await fs.unlink(srcFilePath);
|
||||||
|
|
||||||
await tx.commit();
|
await tx.commit();
|
||||||
|
|
||||||
return newImage;
|
return newImage;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
|
@ -41,6 +41,7 @@ module.exports = Self => {
|
||||||
const deleted = await Promise.all(promises);
|
const deleted = await Promise.all(promises);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
return deleted;
|
return deleted;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (tx) await tx.rollback();
|
if (tx) await tx.rollback();
|
||||||
|
|
|
@ -97,6 +97,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
const sql = ParameterizedSQL.join(stmts, ';');
|
const sql = ParameterizedSQL.join(stmts, ';');
|
||||||
await conn.executeStmt(sql, myOptions);
|
await conn.executeStmt(sql, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (tx) await tx.rollback();
|
if (tx) await tx.rollback();
|
||||||
|
|
|
@ -117,9 +117,6 @@ module.exports = Self => {
|
||||||
if (!zoneShipped || zoneShipped.zoneFk != args.zoneFk)
|
if (!zoneShipped || zoneShipped.zoneFk != args.zoneFk)
|
||||||
throw new UserError(`You don't have privileges to change the zone`);
|
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({
|
const originalTicket = await models.Ticket.findOne({
|
||||||
where: {id: args.id},
|
where: {id: args.id},
|
||||||
|
|
|
@ -70,6 +70,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
await models.ZoneIncluded.create(newIncludedGeo, myOptions);
|
await models.ZoneIncluded.create(newIncludedGeo, myOptions);
|
||||||
await models.ZoneEvent.create(newCalendarDays, myOptions);
|
await models.ZoneEvent.create(newCalendarDays, myOptions);
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
return newZone;
|
return newZone;
|
||||||
|
|
Loading…
Reference in New Issue