#26 - Loading animation + success message fix
This commit was merged in pull request #31.
This commit is contained in:
@@ -16,6 +16,27 @@ class RsvFormSubmitRepository {
|
||||
]);
|
||||
}
|
||||
|
||||
/** Store the derived template context (field values, slots, pricing) for a submission. */
|
||||
public function set_computed(int $id, array $computed): void {
|
||||
Db::update($this->table, ['computed' => json_encode($computed)], ['form_submit_id' => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* The derived template context of the most recent submission for a form,
|
||||
* or null when the form has no submission carrying computed data.
|
||||
*
|
||||
* @return array<string,mixed>|null
|
||||
*/
|
||||
public function latest_computed(int $form_id): ?array {
|
||||
$value = Db::get_var(
|
||||
"SELECT computed FROM {$this->table}
|
||||
WHERE form_id = %d AND computed IS NOT NULL
|
||||
ORDER BY form_submit_id DESC LIMIT 1",
|
||||
[$form_id]
|
||||
);
|
||||
return $value === null ? null : json_decode($value, true);
|
||||
}
|
||||
|
||||
public function delete(int $id): void {
|
||||
Db::delete($this->table, ['form_submit_id' => $id]);
|
||||
}
|
||||
|
||||
@@ -88,8 +88,7 @@ class RsvTimetableReservationRepository {
|
||||
public function get_confirmation_code(int $reservation_id): ?string {
|
||||
return Db::get_var(
|
||||
"SELECT c.code FROM {$this->confirmation_table} c
|
||||
JOIN {$this->table} tr ON tr.id = c.timetable_reservation_id
|
||||
WHERE tr.reservation_id = %d
|
||||
WHERE c.timetable_reservation_id = %d
|
||||
LIMIT 1",
|
||||
[$reservation_id]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user