#26 - Loading animation + success message fix

This commit was merged in pull request #31.
This commit is contained in:
Martin Slachta
2026-06-22 11:20:28 +02:00
parent c754e18a82
commit 97ee8fc991
32 changed files with 597 additions and 175 deletions
@@ -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]);
}