- Booking: added modify a booking (+ emails).

This commit is contained in:
Paolo Arena
2019-10-10 21:08:29 +02:00
parent 2b98516c46
commit 0e0b327858
6 changed files with 47 additions and 8 deletions

View File

@@ -113,6 +113,7 @@ namespace Actions {
datebooked: bookevent.datebooked,
userId: UserStore.state.userId,
booked: bookevent.booked,
modified: bookevent.modified,
}
}
@@ -125,7 +126,15 @@ namespace Actions {
.then((res) => {
if (res.status === 200) {
if (res.data.code === serv_constants.RIS_CODE_OK) {
state.bookedevent.push(bookevent)
if (bookevent.modified) {
const foundIndex = state.bookedevent.findIndex((x) => x.id_bookedevent === bookevent.id_bookedevent)
if (foundIndex >= 0)
state.bookedevent[foundIndex] = bookevent
} else {
state.bookedevent.push(bookevent)
}
return true
}
}