Filling edit form

This commit is contained in:
Juan Pablo Vial
2025-11-12 19:49:08 -03:00
parent e278695137
commit 54969eeeab
6 changed files with 116 additions and 89 deletions

View File

@ -891,12 +891,16 @@
},
units: project_id => {
if (project_id in reservations.data.units) {
reservations.locks.units = null
return new Promise((resolve, reject) => {
resolve(reservations.data.units[project_id])
})
}
if (reservations.locks.units !== null) {
return reservations.locks.units
}
const uri = `/api/proyecto/${project_id}/unidades/disponibles`
return APIClient.fetch(uri).then(response => response.json()).then(json => {
reservations.locks.units = APIClient.fetch(uri).then(response => response.json()).then(json => {
if (json.unidades.length === 0) {
reservations.data.units[project_id] = {}
return reservations.data.units[project_id]
@ -914,6 +918,7 @@
return reservations.data.units[project_id]
})
return reservations.locks.units
},
},
loading: {