Skip to content

Commit b59c994

Browse files
Fixing the table of links in the rest api documentation (#2247)
* Fixing the table of links in the rest api documentation * String to specify the default behavior when creating a document * Updating the links in the sidebar, too * copy fix
1 parent b7cd254 commit b59c994

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

docusaurus/docs/dev-docs/api/rest.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ sources={{
6262

6363
| Method | URL | Description |
6464
| -------- | ------------------------------- | ------------------------------------- |
65-
| `GET` | `/api/:pluralApiId` | [Get a list of document](#get-documents) |
66-
| `POST` | `/api/:pluralApiId` | [Create a document](#create-an-entry) |
67-
| `GET` | `/api/:pluralApiId/:documentId` | [Get a document](#get-an-entry) |
68-
| `PUT` | `/api/:pluralApiId/:documentId` | [Update a document](#update-an-entry) |
69-
| `DELETE` | `/api/:pluralApiId/:documentId` | [Delete a document](#delete-an-entry) |
65+
| `GET` | `/api/:pluralApiId` | [Get a list of document](#get-all) |
66+
| `POST` | `/api/:pluralApiId` | [Create a document](#create) |
67+
| `GET` | `/api/:pluralApiId/:documentId` | [Get a document](#get) |
68+
| `PUT` | `/api/:pluralApiId/:documentId` | [Update a document](#update) |
69+
| `DELETE` | `/api/:pluralApiId/:documentId` | [Delete a document](#delete) |
7070

7171
</TabItem>
7272

@@ -300,7 +300,9 @@ In Strapi 5, a specific document is reached by its `documentId`.
300300

301301
Creates a document and returns its value.
302302

303-
If the [Internationalization (i18n) plugin](/dev-docs/i18n) is installed, it's possible to use POST requests to the REST API to [create localized documents](/dev-docs/i18n#creating-a-new-localized-entry).
303+
By default, a document is created with a published status. To create a document as a draft, pass the [`?status=draft`](/dev-docs/api/rest/filters-locale-publication#status) query parameter.
304+
305+
If the Internationalization (i18n) feature is enabled on the content-type, it's possible to use POST requests to the REST API to [create localized documents](/dev-docs/i18n#creating-a-new-localized-entry).
304306

305307
:::note
306308
While creating a document, you can define its relations and their order (see [Managing relations through the REST API](/dev-docs/api/rest/relations.md) for more details).

docusaurus/sidebars.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -978,27 +978,27 @@ const sidebars = {
978978
{
979979
type: 'link',
980980
label: 'Get documents',
981-
href: '/dev-docs/api/rest#get-documents'
981+
href: '/dev-docs/api/rest#get-all'
982982
},
983983
{
984984
type: 'link',
985985
label: 'Get a document',
986-
href: '/dev-docs/api/rest#get-a-document'
986+
href: '/dev-docs/api/rest#get'
987987
},
988988
{
989989
type: 'link',
990990
label: 'Create a document',
991-
href: '/dev-docs/api/rest#create-a-document'
991+
href: '/dev-docs/api/rest#create'
992992
},
993993
{
994994
type: 'link',
995995
label: 'Update a document',
996-
href: '/dev-docs/api/rest#update-a-document'
996+
href: '/dev-docs/api/rest#update'
997997
},
998998
{
999999
type: 'link',
10001000
label: 'Delete a document',
1001-
href: '/dev-docs/api/rest#delete-a-document'
1001+
href: '/dev-docs/api/rest#delete'
10021002
},
10031003
]
10041004
},

0 commit comments

Comments
 (0)