Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2596,8 +2596,8 @@ paths:
tags: [Toolkits]
summary: Update a Toolkit's number and image settings
description: |
Sets the Toolkit number and whether the thumbnail (on Explore Toolkits) and the cover image (on
the Toolkit's page) are darkened, as the Create/Edit Collection page does. Only the fields sent
Sets the Toolkit number, the cover image's alt text, and whether the thumbnail (on Explore
Toolkits) and the cover image (on the Toolkit's page) are darkened, as the Create/Edit Collection page does. Only the fields sent
change. The user must be able to edit the Toolkit: its owner, an editor of its Organisation, or
a user with Marketing or Admin system access.
operationId: updateToolkit
Expand All @@ -2613,6 +2613,7 @@ paths:
example:
toolkit_number: "T14"
darken_cover_image: true
cover_image_alt: "Volunteers sorting food parcels"
responses:
"200":
description: The Toolkit
Expand Down Expand Up @@ -21084,6 +21085,10 @@ components:
type: string
nullable: true
description: The image at the top of the Toolkit's page
cover_image_alt:
type: string
nullable: true
description: The cover image's alt text, read out by screen readers; when null, the image is treated as decoration
darken_thumbnail_image:
type: boolean
description: Whether a dark translucent layer covers the thumbnail on Explore Toolkits
Expand Down Expand Up @@ -21122,6 +21127,11 @@ components:
toolkit_number:
type: string
nullable: true
cover_image_alt:
type: string
nullable: true
maxLength: 255
description: The cover image's alt text, as on the Create/Edit Collection page; send null or "" for a decorative image
darken_thumbnail_image:
type: boolean
darken_cover_image:
Expand Down
7 changes: 4 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1430,15 +1430,16 @@ function buildDocsPage() {
${endpointCard("GET", "/toolkits/{id}", "Get a Toolkit", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Toolkit ID" }
], [
{ code: "200", cls: "response-2xx", desc: "The Toolkit: <code>toolkit_number</code>, <code>thumbnail_image_url</code>, <code>cover_image_url</code>, <code>darken_thumbnail_image</code>, <code>darken_cover_image</code> and its page <code>url</code>" },
{ code: "200", cls: "response-2xx", desc: "The Toolkit: <code>toolkit_number</code>, <code>thumbnail_image_url</code>, <code>cover_image_url</code>, <code>cover_image_alt</code>, <code>darken_thumbnail_image</code>, <code>darken_cover_image</code> and its page <code>url</code>" },
{ code: "401", cls: "response-4xx", desc: "Not authenticated" },
{ code: "404", cls: "response-4xx", desc: "Not found, or a Toolkit you can't see" }
])}
${endpointCard("PATCH", "/toolkits/{id}", "Change a Toolkit's number and image darkening", true, [
${endpointCard("PATCH", "/toolkits/{id}", "Change a Toolkit's number, cover image alt text and image darkening", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Toolkit ID" },
{ name: "toolkit_number", type: "string", required: false, desc: "The Toolkit's number, e.g. <code>T14</code>; <code>null</code> clears it" },
{ name: "darken_thumbnail_image", type: "boolean", required: false, desc: "Darken the thumbnail on Explore Toolkits" },
{ name: "darken_cover_image", type: "boolean", required: false, desc: "Darken the cover image on the Toolkit's page" }
{ name: "darken_cover_image", type: "boolean", required: false, desc: "Darken the cover image on the Toolkit's page" },
{ name: "cover_image_alt", type: "string", required: false, desc: "The cover image's alt text for screen readers, up to 255 characters; <code>null</code> or empty marks the image as decoration" }
], [
{ code: "200", cls: "response-2xx", desc: "The Toolkit" },
{ code: "401", cls: "response-4xx", desc: "Not authenticated" },
Expand Down
Loading