[FIX] JE dois pouvoir modifier les nomes des parties d'un morceau
complexe #6
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user