From 7c4ab578ca524bb9f3f935f3ccd3baa253b74173 Mon Sep 17 00:00:00 2001 From: marcoautiero Date: Tue, 1 Oct 2024 14:08:56 +0200 Subject: [PATCH 1/4] Fixing the table of links in the rest api documentation --- docusaurus/docs/dev-docs/api/rest.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docusaurus/docs/dev-docs/api/rest.md b/docusaurus/docs/dev-docs/api/rest.md index 5e3a535236..2779f889d0 100644 --- a/docusaurus/docs/dev-docs/api/rest.md +++ b/docusaurus/docs/dev-docs/api/rest.md @@ -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) | @@ -300,7 +300,7 @@ 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). +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). From b68a150f6a4eb9529c0251ee6ebcc9402e7e2b58 Mon Sep 17 00:00:00 2001 From: marcoautiero Date: Tue, 1 Oct 2024 14:45:14 +0200 Subject: [PATCH 2/4] String to specify the default behavior when creating a document --- docusaurus/docs/dev-docs/api/rest.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docusaurus/docs/dev-docs/api/rest.md b/docusaurus/docs/dev-docs/api/rest.md index 2779f889d0..9d577ac1b9 100644 --- a/docusaurus/docs/dev-docs/api/rest.md +++ b/docusaurus/docs/dev-docs/api/rest.md @@ -300,6 +300,8 @@ In Strapi 5, a specific document is reached by its `documentId`. Creates a document and returns its value. +By default, a document is created with a published status. To create a document as a draft, pass the [`status`](/dev-docs/api/rest/filters-locale-publication#status) parameter with the value `draft`. + 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 From b5f72881b84173315a86ca61c09d3ae422cde0f2 Mon Sep 17 00:00:00 2001 From: marcoautiero Date: Tue, 1 Oct 2024 14:46:11 +0200 Subject: [PATCH 3/4] Updating the links in the sidebar, too --- docusaurus/sidebars.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docusaurus/sidebars.js b/docusaurus/sidebars.js index f98da6cdc5..3ba6fef629 100644 --- a/docusaurus/sidebars.js +++ b/docusaurus/sidebars.js @@ -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' }, ] }, From bec3e8341d7348d6772b5238468d8717a1ea28fc Mon Sep 17 00:00:00 2001 From: marcoautiero Date: Tue, 1 Oct 2024 16:11:25 +0200 Subject: [PATCH 4/4] copy fix --- docusaurus/docs/dev-docs/api/rest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus/docs/dev-docs/api/rest.md b/docusaurus/docs/dev-docs/api/rest.md index 9d577ac1b9..431256ffea 100644 --- a/docusaurus/docs/dev-docs/api/rest.md +++ b/docusaurus/docs/dev-docs/api/rest.md @@ -300,7 +300,7 @@ In Strapi 5, a specific document is reached by its `documentId`. Creates a document and returns its value. -By default, a document is created with a published status. To create a document as a draft, pass the [`status`](/dev-docs/api/rest/filters-locale-publication#status) parameter with the value `draft`. +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).