[FIX] JE dois pouvoir modifier les nomes des parties d'un morceau

complexe #6
This commit is contained in:
NADAL Jean-Baptiste
2026-02-26 18:25:54 +01:00
parent 96628ef4b8
commit 5275acc4ff
5 changed files with 138 additions and 2 deletions

View File

@@ -343,6 +343,24 @@ if (preg_match('#^admin/scores/(\d+)$#', $path, $matches) && $method === 'PUT')
exit;
}
// PUT /admin/scores/:id/pieces - Update pieces
if (preg_match('#^admin/scores/(\d+)/pieces$#', $path, $matches) && $method === 'PUT') {
$scoreId = $matches[1];
$input = json_decode(file_get_contents('php://input'), true);
$pieces = $input['pieces'] ?? [];
$result = $scanner->updatePieces($scoreId, $pieces);
if ($result['success']) {
echo json_encode(['success' => true]);
} else {
http_response_code(400);
echo json_encode(['error' => $result['error']]);
}
exit;
}
// DELETE /admin/scores/:id - Delete score
if (preg_match('#^admin/scores/(\d+)$#', $path, $matches) && $method === 'DELETE') {
$scoreId = $matches[1];