DB4ls_all: bei DELTEONE den TYP mit auswerten

anmeld.js: den TYP mit übergeben
Version angepasst
This commit is contained in:
rxf
2026-01-20 15:17:13 +01:00
parent b77cb63758
commit f6e9f0fef6
3 changed files with 12 additions and 8 deletions

View File

@@ -355,9 +355,10 @@ class RepoAnmeld
$id
]);
}
public static function delete(int $id): int
public static function delete(int $id, string $typ): int
{
return DB::exec("DELETE FROM " . TBL_ANMELD . " WHERE id=?", [$id]);
$table = ($typ == 'regular') ? TBL_ANMELD : TBL_SONNEANMELD;
return DB::exec("DELETE FROM " . $table . " WHERE id=?", [$id]);
}
public static function bulkUpdateField(array $ids, string $field, $value): int
{
@@ -1115,10 +1116,10 @@ try {
RepoAnmeld::update((int)$input['id'], $input);
respond(['success' => true]);
case 'DELETE_TLN':
RepoAnmeld::delete((int)$input['id']);
RepoAnmeld::delete((int)$input['id'], $input['typ']);
respond(['success' => true]);
case 'DELETEONE': // alias for legacy
RepoAnmeld::delete((int)$input['id']);
RepoAnmeld::delete((int)$input['id'], $input['typ']);
respond(['success' => true]);
case 'UPDATE_TLN_BULK':
if (!isset($input['ids'], $input['field'], $input['values'])) respondError('Missing fields');

View File

@@ -130,7 +130,7 @@ Beobachtergruppe Sternwarte Welzheim`
// Teilnehmer aus 'anmeldungen' austragen und den count in 'fdatum1' anpassen
const austragen = async (teilnehmer) => {
let update = {cmd: 'DELETEONE', id: parseInt(teilnehmer.id)}
let update = {cmd: 'DELETEONE', id: parseInt(teilnehmer.id), typ: query.typ}
const erg1 = await putToDbase(update)
update = {cmd: 'UPDATECOUNT', date: parseInt(teilnehmer.fdatum), anzahl: parseInt(teilnehmer.anzahl)}
const erg2 = await putToDbase(update)

View File

@@ -1,12 +1,15 @@
// VersiosNummern und -Geschichte
const VERSION="1.12.0";
const VDATE="2026-01-11";
const VERSION="1.12.1";
const VDATE="2026-01-20";
/* History
Rev. Datum Entwickler
1.12.1 2026-01-20 rxf
- bei DELETEONE den typ mit übergeben (sonst geht storno bei sonne nicht)
1.12.0 2026-01-11 rxf
- Abmeldedatum richtig als einfacher String mit Sekunden abspeichern