fix(card): pass required type field to createCard#89
Merged
Conversation
Planka v2 split cards into two kinds — `project` and `story` — and
the `type` field is now required on `POST /api/lists/{listId}/cards`.
Without it, every createCard returned 400 (visible in the trace logs:
"created card NNN status 400" for every card).
Existing email-to-card flow corresponds to the regular `project`
kind (the spec's example default). `story` cards are for user-story
workflows with sub-issues, which we don't use.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Trace logs after the v3 client bump show every `createCard` call returning 400:
```
[TRACE] Planka - created card 178 status 400
[TRACE] Planka - created card 177 status 400
...
```
Planka v2 split cards into two kinds and `type` is now a required body field on `POST /api/lists/{listId}/cards`:
```json
"required": ["type", "name"],
"properties": {
"type": { "enum": ["project", "story"] },
...
}
```
I missed this in #85 — the migration kept the v1 body shape (`name`/`position` only) which is now rejected.
Fix
Add `type: 'project'` to the request body. The email-to-card flow corresponds to plain "project" cards (the spec's example default); `story` is for user-story workflows with sub-issues which we don't use.