From ab801c7f01f9950ad586cb28a9d956f42a803b62 Mon Sep 17 00:00:00 2001 From: Carmen Huidobro Date: Wed, 18 Dec 2024 12:06:13 +0100 Subject: [PATCH] Add hack to dashboards --- api-spec/index.yaml | 2 + .../#\342\200\216/createDashboard.yaml" | 41 +++++++++++++++++++ .../dashboards/#\342\200\216/index.yaml" | 2 + 3 files changed, 45 insertions(+) create mode 100644 "api-spec/paths/dashboards/#\342\200\216/createDashboard.yaml" create mode 100644 "api-spec/paths/dashboards/#\342\200\216/index.yaml" diff --git a/api-spec/index.yaml b/api-spec/index.yaml index b059573e..a1ad6449 100644 --- a/api-spec/index.yaml +++ b/api-spec/index.yaml @@ -41,6 +41,8 @@ paths: $ref: paths/comments/_id/index.yaml "/dashboards": $ref: paths/dashboards/index.yaml + "/dashboards#‎": + $ref: paths/dashboards/#‎/index.yaml "/dashboards/{id}": $ref: paths/dashboards/_id/index.yaml "/extensions": diff --git "a/api-spec/paths/dashboards/#\342\200\216/createDashboard.yaml" "b/api-spec/paths/dashboards/#\342\200\216/createDashboard.yaml" new file mode 100644 index 00000000..de1808ee --- /dev/null +++ "b/api-spec/paths/dashboards/#\342\200\216/createDashboard.yaml" @@ -0,0 +1,41 @@ +summary: Create a Dashboard +description: Create a new dashboard. +operationId: createDashboard +parameters: +- $ref: ../../../components/parameters.yaml#/Fields +- $ref: ../../../components/parameters.yaml#/Meta +requestBody: + content: + application/json: + schema: + anyOf: + - $ref: ../../../components/schemas/dashboards.yaml +responses: + '200': + description: Successful request + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../../components/schemas/dashboards.yaml + '401': + $ref: ../../../components/responses.yaml#/UnauthorizedError + '404': + $ref: ../../../components/responses.yaml#/NotFoundError +tags: +- Dashboards +x-codeSamples: + - label: Directus SDK + lang: JavaScript + source: | + import { createDirectus, rest, createDashboard } from '@directus/sdk'; + const client = createDirectus('directus_project_url').with(rest()); + const result = await client.request(createDashboard(dashboard_object)); + - label: GraphQL + lang: GraphQL + source: | + type Mutation { + create_dashboards_item(data: create_directus_dashboards_input!): directus_dashboards + } diff --git "a/api-spec/paths/dashboards/#\342\200\216/index.yaml" "b/api-spec/paths/dashboards/#\342\200\216/index.yaml" new file mode 100644 index 00000000..39eb83d6 --- /dev/null +++ "b/api-spec/paths/dashboards/#\342\200\216/index.yaml" @@ -0,0 +1,2 @@ +post: + $ref: createDashboard.yaml