Skip to content

Commit ab801c7

Browse files
committed
Add hack to dashboards
1 parent 442383f commit ab801c7

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

api-spec/index.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ paths:
4141
$ref: paths/comments/_id/index.yaml
4242
"/dashboards":
4343
$ref: paths/dashboards/index.yaml
44+
"/dashboards#‎":
45+
$ref: paths/dashboards/#‎/index.yaml
4446
"/dashboards/{id}":
4547
$ref: paths/dashboards/_id/index.yaml
4648
"/extensions":
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
summary: Create a Dashboard
2+
description: Create a new dashboard.
3+
operationId: createDashboard
4+
parameters:
5+
- $ref: ../../../components/parameters.yaml#/Fields
6+
- $ref: ../../../components/parameters.yaml#/Meta
7+
requestBody:
8+
content:
9+
application/json:
10+
schema:
11+
anyOf:
12+
- $ref: ../../../components/schemas/dashboards.yaml
13+
responses:
14+
'200':
15+
description: Successful request
16+
content:
17+
application/json:
18+
schema:
19+
type: object
20+
properties:
21+
data:
22+
$ref: ../../../components/schemas/dashboards.yaml
23+
'401':
24+
$ref: ../../../components/responses.yaml#/UnauthorizedError
25+
'404':
26+
$ref: ../../../components/responses.yaml#/NotFoundError
27+
tags:
28+
- Dashboards
29+
x-codeSamples:
30+
- label: Directus SDK
31+
lang: JavaScript
32+
source: |
33+
import { createDirectus, rest, createDashboard } from '@directus/sdk';
34+
const client = createDirectus('directus_project_url').with(rest());
35+
const result = await client.request(createDashboard(dashboard_object));
36+
- label: GraphQL
37+
lang: GraphQL
38+
source: |
39+
type Mutation {
40+
create_dashboards_item(data: create_directus_dashboards_input!): directus_dashboards
41+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
post:
2+
$ref: createDashboard.yaml

0 commit comments

Comments
 (0)