fix(planka): propagation erreurs Planka + noms étiquettes + position dans saveCard
Deploy HouseHub / deploy (push) Successful in 2s
Deploy HouseHub / deploy (push) Successful in 2s
- update_card: transmet position à Planka + retourne erreur réelle si Planka rejette - saveCard: n'envoie listId que si changé (position requise par Planka), sinon nom/desc/dueDate seul - Labels: affiche le nom en texte dans le badge coloré (comme Planka) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
5828d1796d
commit
e770ccf22b
@@ -127,12 +127,14 @@ if ($action === 'update_card') {
|
||||
$id = $_GET['id'] ?? null; if (!$id) tErr('ID manquant');
|
||||
$d = tBody();
|
||||
$payload = [];
|
||||
if (isset($d['name'])) $payload['name'] = $d['name'];
|
||||
if (isset($d['description'])) $payload['description'] = $d['description'];
|
||||
if (array_key_exists('dueDate', $d)) $payload['dueDate'] = $d['dueDate'];
|
||||
if (isset($d['listId'])) $payload['listId'] = $d['listId'];
|
||||
if (isset($d['name'])) $payload['name'] = $d['name'];
|
||||
if (isset($d['description'])) $payload['description'] = $d['description'];
|
||||
if (array_key_exists('dueDate', $d)) $payload['dueDate'] = $d['dueDate'];
|
||||
if (isset($d['listId'])) $payload['listId'] = $d['listId'];
|
||||
if (isset($d['position'])) $payload['position'] = (float)$d['position'];
|
||||
$resp = planka_api('PATCH', '/api/cards/' . $id, $payload, $token);
|
||||
tOk($resp['item'] ?? []);
|
||||
if (empty($resp['item'])) tErr($resp['message'] ?? ($resp['problems'][0] ?? 'Planka a rejeté la mise à jour'), 502);
|
||||
tOk($resp['item']);
|
||||
}
|
||||
|
||||
if ($action === 'delete_card') {
|
||||
|
||||
Reference in New Issue
Block a user