From a52ffdd816eddf04d54cd06dee4e4d662594e7dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Y=C4=B1ld=C4=B1ray=20=C3=9Cnl=C3=BC?= Date: Wed, 2 Jun 2021 15:53:01 +0300 Subject: [PATCH 1/5] Update Identifier -> string. --- .../guides-and-concepts/hooks/data/useCreate.md | 2 +- .../hooks/data/useCreateMany.md | 2 +- .../guides-and-concepts/hooks/data/useDelete.md | 10 +++++----- .../hooks/data/useDeleteMany.md | 10 +++++----- .../guides-and-concepts/hooks/data/useUpdate.md | 2 +- .../hooks/data/useUpdateMany.md | 10 +++++----- example/src/components/pages/category.tsx | 10 ++++++---- example/src/components/pages/landing.tsx | 4 ++-- example/src/components/pages/post-light.tsx | 6 +++--- example/src/components/pages/post.tsx | 4 ++-- example/src/components/pages/tag.tsx | 4 ++-- example/src/components/pages/tags.tsx | 4 ++-- example/src/components/pages/user.tsx | 2 +- examples/useDeleteMany/src/pages/posts/list.tsx | 6 ++---- examples/useUpdateMany/src/pages/posts/list.tsx | 6 ++---- .../core/src/components/buttons/clone/index.tsx | 2 +- .../core/src/components/buttons/delete/index.tsx | 2 +- .../core/src/components/buttons/edit/index.tsx | 2 +- .../core/src/components/buttons/refresh/index.tsx | 2 +- .../core/src/components/buttons/show/index.tsx | 2 +- packages/core/src/components/crud/edit/index.tsx | 2 +- packages/core/src/components/crud/show/index.tsx | 2 +- packages/core/src/contexts/data/IDataContext.ts | 14 +++++++------- packages/core/src/hooks/data/useDelete.ts | 10 +++------- .../core/src/hooks/data/useDeleteMany.spec.tsx | 4 ++-- packages/core/src/hooks/data/useDeleteMany.ts | 13 +++++-------- packages/core/src/hooks/data/useMany.ts | 3 +-- packages/core/src/hooks/data/useOne.ts | 3 +-- packages/core/src/hooks/data/useUpdate.ts | 8 ++------ packages/core/src/hooks/data/useUpdateMany.ts | 9 ++++----- .../src/hooks/form/useCloneForm/useCloneForm.ts | 10 +++++----- .../src/hooks/form/useCreateForm/useCreateForm.ts | 8 ++++---- .../form/useDrawerForm/useDrawerForm.spec.tsx | 2 +- .../src/hooks/form/useDrawerForm/useDrawerForm.ts | 2 +- .../core/src/hooks/form/useEditForm/useEditForm.ts | 10 +++++----- packages/core/src/hooks/form/useForm.ts | 10 +++++----- .../hooks/form/useModalForm/useModalForm.spec.tsx | 2 +- .../src/hooks/form/useModalForm/useModalForm.ts | 2 +- packages/core/src/hooks/navigation/index.spec.tsx | 12 ++++++------ packages/core/src/hooks/navigation/index.ts | 14 +++----------- packages/core/src/hooks/redirection/index.ts | 4 ++-- .../useEditableTable/useEditableTable.spec.tsx | 2 +- .../table/useEditableTable/useEditableTable.ts | 8 ++++---- packages/core/src/interfaces/index.ts | 4 +--- .../src/interfaces/reducers/resource/resource.d.ts | 2 +- packages/core/types/sunflower.d.ts | 3 ++- packages/json-server/test/deleteMany/index.spec.ts | 2 +- packages/json-server/test/deleteOne/index.spec.ts | 2 +- packages/json-server/test/getMany/index.spec.ts | 2 +- packages/json-server/test/getOne/index.spec.ts | 2 +- packages/json-server/test/update/index.spec.ts | 2 +- packages/json-server/test/updateMany/index.spec.ts | 2 +- packages/strapi/src/dataProvider.ts | 4 +--- packages/strapi/test/dataProvider/index.spec.ts | 8 ++++---- 54 files changed, 126 insertions(+), 153 deletions(-) diff --git a/documentation/docs/guides-and-concepts/hooks/data/useCreate.md b/documentation/docs/guides-and-concepts/hooks/data/useCreate.md index d1e2744f2661..9d341866341b 100644 --- a/documentation/docs/guides-and-concepts/hooks/data/useCreate.md +++ b/documentation/docs/guides-and-concepts/hooks/data/useCreate.md @@ -39,7 +39,7 @@ Let'say we have a `categories` resource ```tsx type CategoryMutationResult = { - id: string | number; + id: string; title: string; } diff --git a/documentation/docs/guides-and-concepts/hooks/data/useCreateMany.md b/documentation/docs/guides-and-concepts/hooks/data/useCreateMany.md index 7f97c64910b8..82f095b4f047 100644 --- a/documentation/docs/guides-and-concepts/hooks/data/useCreateMany.md +++ b/documentation/docs/guides-and-concepts/hooks/data/useCreateMany.md @@ -36,7 +36,7 @@ Let'say we have a `categories` resource ```tsx type CategoryMutationResult = { - id: string | number; + id: string; title: string; } diff --git a/documentation/docs/guides-and-concepts/hooks/data/useDelete.md b/documentation/docs/guides-and-concepts/hooks/data/useDelete.md index cb7fa28bb84a..f0d57c8c5baa 100644 --- a/documentation/docs/guides-and-concepts/hooks/data/useDelete.md +++ b/documentation/docs/guides-and-concepts/hooks/data/useDelete.md @@ -76,7 +76,7 @@ Variables passed to `mutate` must have the type of ```tsx { - id: string | number; + id: string; } ``` ::: @@ -146,9 +146,9 @@ After 7.5 seconds the mutation will be executed. The mutation can be cancelled w ### Return value - | Description | Type | - | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | Result of the `react-query`'s useMutation | [`UseMutationResult<`
`{ data: TData },`
`TError,`
` { id: Identifier; },`
` DeleteContext>`](https://react-query.tanstack.com/reference/useMutation) | + | Description | Type | + | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | + | Result of the `react-query`'s useMutation | [`UseMutationResult<`
`{ data: TData },`
`TError,`
` { id: string; },`
` DeleteContext>`](https://react-query.tanstack.com/reference/useMutation) | ->`*` [Refer to documentation for `Identifier` →](#) and [`DeleteContext` →](#) +>`*` [Refer to documentation for [`DeleteContext` →](#) diff --git a/documentation/docs/guides-and-concepts/hooks/data/useDeleteMany.md b/documentation/docs/guides-and-concepts/hooks/data/useDeleteMany.md index b0b042b36081..bb7ce34ec2d8 100644 --- a/documentation/docs/guides-and-concepts/hooks/data/useDeleteMany.md +++ b/documentation/docs/guides-and-concepts/hooks/data/useDeleteMany.md @@ -80,7 +80,7 @@ Values passed to `mutate` must have the type of ```tsx { - ids: (string | number)[]; + ids: (string)[]; } ``` ::: @@ -150,11 +150,11 @@ After 7.5 seconds the mutation will be executed. The mutation can be cancelled w ### Return value -| Description | Type | -| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Result of the `react-query`'s useMutation | [`UseMutationResult<`
`{ data: TData },`
`TError,`
` { ids: Identifier[]; },`
` DeleteContext>`](https://react-query.tanstack.com/reference/useMutation)* | +| Description | Type | +| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Result of the `react-query`'s useMutation | [`UseMutationResult<`
`{ data: TData },`
`TError,`
` { ids: string[]; },`
` DeleteContext>`](https://react-query.tanstack.com/reference/useMutation)* | ->`*` Refer to documentation for `Identifier` →](#) and [`DeleteContext` →](#) +>`*` Refer to documentation for [`DeleteContext` →](#)