Skip to content

Commit

Permalink
Fixing the table of links in the rest api documentation (#2247)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
maccomaccomaccomacco authored Oct 2, 2024
1 parent b7cd254 commit b59c994
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
14 changes: 8 additions & 6 deletions docusaurus/docs/dev-docs/api/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ sources={{

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

</TabItem>

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

Creates a document and returns its value.

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).
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.

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).

:::note
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).
Expand Down
10 changes: 5 additions & 5 deletions docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -978,27 +978,27 @@ const sidebars = {
{
type: 'link',
label: 'Get documents',
href: '/dev-docs/api/rest#get-documents'
href: '/dev-docs/api/rest#get-all'
},
{
type: 'link',
label: 'Get a document',
href: '/dev-docs/api/rest#get-a-document'
href: '/dev-docs/api/rest#get'
},
{
type: 'link',
label: 'Create a document',
href: '/dev-docs/api/rest#create-a-document'
href: '/dev-docs/api/rest#create'
},
{
type: 'link',
label: 'Update a document',
href: '/dev-docs/api/rest#update-a-document'
href: '/dev-docs/api/rest#update'
},
{
type: 'link',
label: 'Delete a document',
href: '/dev-docs/api/rest#delete-a-document'
href: '/dev-docs/api/rest#delete'
},
]
},
Expand Down

0 comments on commit b59c994

Please sign in to comment.