Skip to content

Commit

Permalink
Fix returning value after delete record
Browse files Browse the repository at this point in the history
  • Loading branch information
treoden committed May 9, 2024
1 parent 4bab83e commit 2e387f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ module.exports = async (request, response, deledate, next) => {
});
return;
}
const zone = await del('shipping_zone')
.where('uuid', '=', id)
.execute(connection);

await del('shipping_zone').where('uuid', '=', id).execute(connection);
await commit(connection);
response.status(OK);
response.json({
data: zone
data: shippingZone
});
} catch (e) {
error(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ module.exports = async (request, response, deledate, next) => {
}

// Delete the shipping zone method
const method = await del('shipping_zone_method')
await del('shipping_zone_method')
.where('method_id', '=', zoneMethod.shipping_method_id)
.and('zone_id', '=', shippingZone.shipping_zone_id)
.execute(connection);
await commit(connection);
response.status(OK);
response.json({
data: method
data: zoneMethod
});
} catch (e) {
await rollback(connection);
Expand Down

0 comments on commit 2e387f6

Please sign in to comment.