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') {
|
||||
|
||||
@@ -166,10 +166,22 @@
|
||||
}
|
||||
|
||||
.pk-label {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: 20px;
|
||||
padding: 0 8px;
|
||||
border-radius: 4px;
|
||||
font-size: .72rem;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
text-shadow: 0 1px 2px rgba(0,0,0,.3);
|
||||
min-width: 36px;
|
||||
}
|
||||
.pk-label:empty {
|
||||
height: 6px;
|
||||
width: 36px;
|
||||
border-radius: 3px;
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.pk-card-name {
|
||||
|
||||
Reference in New Issue
Block a user