refactor: refs #6824 Throw for no delete itemShelving with itemShelvingSale #3057
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#3057
Loading…
Reference in New Issue
No description provided.
Delete Branch "6824-itemShelvingSaleNoDelete"
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?
@ -15,0 +5,4 @@
BEGIN
DECLARE vItemShelvingSaleExists BOOL;
SELECT COUNT(*) INTO vItemShelvingSaleExists
itemShelvingSale esta es la part que no cal fer, sino canviar en itemShelvingSale a un Fk restrict
@ -34,6 +34,11 @@ module.exports = Self => {
try {
const promises = [];
for (let itemShelvingId of itemShelvingIds) {
const itemShelvingSaleToDelete = models.ItemShelvingSale.destroyAll({
açò quina part del redmine es? perque si el itemShelving te sales, no es vol que se puguen borrar.
Aixo ho faig en els tests intenta eliminar un itemShelving que conte itemShelvingSale, per lo tant, primer tinc que carregarme els itemShelvingSale i despres els itemShelvings, si no els tests fallen.