Skip to content

Commit

Permalink
Add hack to dashboards
Browse files Browse the repository at this point in the history
  • Loading branch information
hola-soy-milk committed Dec 18, 2024
1 parent 442383f commit ab801c7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api-spec/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
41 changes: 41 additions & 0 deletions api-spec/paths/dashboards/#‎/createDashboard.yaml
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 2 additions & 0 deletions api-spec/paths/dashboards/#‎/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
post:
$ref: createDashboard.yaml

0 comments on commit ab801c7

Please sign in to comment.