Garage : fix select avec valeurs hors-liste (type, fuel_type, category)
Deploy to Pacha Family / deploy (push) Failing after 3s
Deploy to Pacha Family / deploy (push) Failing after 3s
setSelectVal() ajoute dynamiquement l'option si elle n'existe pas dans le select, évitant que .value reste vide et soit envoyé null à l'API. Validation PHP côté serveur : type et date requis sur PUT maintenance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
5ac4e51efb
commit
b338d7550a
@@ -109,6 +109,8 @@ if ($action === 'maintenances') {
|
||||
}
|
||||
if ($method === 'PUT') {
|
||||
$id = $_GET['id'] ?? null; if (!$id) gErr('ID manquant'); $d = gBody();
|
||||
if (empty($d['type'])) gErr('Le type est requis');
|
||||
if (empty($d['date'])) gErr('La date est requise');
|
||||
$int_f = ['km','next_km']; $float_f = ['cost'];
|
||||
$fields = ['type','description','date','km','cost','mechanic','garage_name','next_km','next_date','notes'];
|
||||
$sets = array_map(fn($f) => "$f = ?", $fields);
|
||||
|
||||
Reference in New Issue
Block a user