3752-claim_action #939
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#939
Loading…
Reference in New Issue
No description provided.
Delete Branch "3752-claim_action"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -0,0 +1,49 @@
module.exports = Self => {
Self.remoteMethodCtx('deleteSalesClaimed', {
delete the claimed sales = deleteClamedSales
@ -0,0 +1,49 @@
module.exports = Self => {
Self.remoteMethodCtx('deleteSalesClaimed', {
description: 'Deletes the selected sales',
Deletes the claimed sales?
@ -0,0 +36,4 @@
promises.push(deletedSale);
}
const deletedSales = await Promise.all(promises);
What happens if the claim ends up empty? shouldn't we delete it?
@ -0,0 +37,4 @@
const models = Self.app.models;
for (let row of rows) {
const claimEnd = await models.ClaimEnd.findById(row.id, null, myOptions);
await claimEnd.updateAttribute('claimDestinationFk', claimDestinationFk, myOptions);
const updatedClaimEnd = claimEnd.updateAttribute('claimDestinationFk', claimDestinationFk, myOptions);
promises.push(updatedClaimEnd);
this way all queries are made with promise.all instead of firing several queries
LGTM