Avoid conflict when decrementing sequence numbers

This commit is contained in:
D. Berge
2020-10-09 14:06:38 +02:00
parent 9fd48c6a5a
commit 5415e81334

View File

@@ -395,8 +395,11 @@ export default {
},
async shiftSequences(delta) {
// We go backwards so as to avoid conflicts.
for (const line of [...this.items].reverse()) {
const lines = delta < 0
? this.items
: [...this.items].reverse(); // We go backwards so as to avoid conflicts.
for (const line of lines) {
const sequence = line.sequence+delta;
const url = `/project/${this.$route.params.project}/plan/${line.sequence}`;
const init = {