Edit modal, validation of whole data

This commit is contained in:
Juan Pablo Vial
2025-11-13 18:57:58 -03:00
parent 539ac3c0e8
commit a6037e4e14
8 changed files with 195 additions and 35 deletions

View File

@ -91,8 +91,14 @@
if (reservations.locks.promotions !== null) {
await reservations.locks.promotions
}
const idxs = []
promotions.forEach(promotion => {
const idx = this.add()
idxs.push(idx)
})
let i = 0
promotions.forEach(promotion => {
const idx = idxs[i ++]
const dropdown = $(this.components.promotions.querySelector(`div.promotion[data-id="${idx}"]`).querySelector('div.dropdown'))
dropdown.dropdown('set selected', promotion.id)
})