fix(pinterest): restore board picker + require board_id in validation#39
Merged
Conversation
The post editor lost the Pinterest board picker during a UI rewrite, causing scheduled posts to fail in production with 'Pinterest board_id is required'. This restores the picker and locks the contract with validation + tests so the regression cannot happen silently again. Backend: - PostController: pinterestBoards is now Record<account_id, Board[]> (mirrors the TikTok creator-info pattern); supports multi-account. - UpdatePostRequest: 'platforms.*.meta.board_id' rule + after-validator rejects Publishing/Scheduling Pinterest posts without board_id. Frontend: - PinterestSettings.vue: Combobox board picker with empty-state warning; emits update:meta with board_id. - ScheduleTab / PostEditorSidebar / Edit pass pinterestBoards down by social_account_id. Tests (6 new): - UpdatePostRequestTest: rejects publishing/scheduling without board_id across pin/carousel/video pin; allows draft without board_id; pinterest error doesn't block sibling platforms in multi-platform. - PinterestPublisherTest: publisher throws for carousel + video pin when no board_id (existing image-pin case kept). 1542 tests passing.
- PinterestSettings: replace inline error markup with the shared
InputError component (matches the rest of the form patterns)
- Extract PinterestBoard type to @/types and use it across
PinterestSettings, ScheduleTab, PostEditorSidebar, Edit — drops
the duplicated inline {id, name} shape from 4 call sites
- Block publish/schedule when Pinterest is selected but no board is
picked (mirrors tiktokComplianceValid). Tooltip surfaces the same
i18n key the backend uses, so frontend + backend speak the same
language
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.
The bug
Production: scheduled Pinterest posts failing with "Pinterest board_id is required". The post editor lost the board picker during a UI rewrite (commit `35646bb`), so users couldn't select a board, and there was no backend validation catching it.
What this does
Backend
Frontend
Tests (6 new, 1542 total)
Regression-prevention is the explicit goal — if anyone removes the picker again or weakens the validation, the build breaks:
Test plan
Follow-ups (not in this PR)