admin-components
Update, publish or unpublish a component
Partial update. Only the keys of AdminComponentPatch are taken from the body; any other key is ignored. Values are passed to PocketBase without further validation, so anything PocketBase rejects (and invalid JSON) answers 500.
- brand is a brand name: it is matched or created in component_brands; an empty or non-string value clears the relation.
- published: true enforces the publication gate: summary (sent, or else stored) must be non-empty, otherwise 400. A sent non-empty slug is used; without a sent or stored slug one is derived from name and brand and made unique with -2 … -50 (500 when none is free); a stored slug is kept when none is sent. published_at is set to now when neither sent nor stored.
- affiliate_links (when an array) replaces the link set: stored links whose id is missing from the array are deleted, entries with id are updated (url, country), entries without id are created; entries lacking url or country are skipped.
Afterwards the cached component reads and the public pages /components and /components/<slug> are revalidated.
patch/api/admin/components/{id}
Request
- Base URL: https://voltplan.app
- URL: https://voltplan.app/api/admin/components/{id}
- Auth: HTTP bearer
Request body
Response
Updated record (without expand).
Changes
No recorded changes to this operation across all 1 revision of this API.