@connectedxm/admin 2.3.18 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/rules/creating-a-mutation.mdc +17 -0
- package/.cursor/rules/creating-a-query.mdc +9 -8
- package/dist/index.cjs +1196 -219
- package/dist/index.d.cts +722 -170
- package/dist/index.d.ts +722 -170
- package/dist/index.js +1097 -196
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
When creating a Mutation file to interact with a put, post, delete endpoint in the API you should follow the same template.
|
|
7
|
+
|
|
8
|
+
1. First check for Params in the [params.ts](mdc:admin-sdk/src/params.ts) file
|
|
9
|
+
2. Then check for the interfaces in [interfaces.ts](mdc:admin-sdk/src/interfaces.ts) file
|
|
10
|
+
3. Create the file in the mutations folder
|
|
11
|
+
- a set of params
|
|
12
|
+
- the function to interact with the api
|
|
13
|
+
- the react-query mutation hook to use the function
|
|
14
|
+
|
|
15
|
+
Create Example: [useCreateAccount.ts](mdc:admin-sdk/src/mutations/account/useCreateAccount.ts)
|
|
16
|
+
Update Example: [useUpdateAccount.ts](mdc:admin-sdk/src/mutations/account/useUpdateAccount.ts)
|
|
17
|
+
Delete Example: [useDeleteAccount.ts](mdc:admin-sdk/src/mutations/account/useDeleteAccount.ts)
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description:
|
|
3
3
|
globs:
|
|
4
4
|
alwaysApply: false
|
|
5
5
|
---
|
|
6
6
|
When creating a Query function to interact with a get or list endpoint in the API you should follow the same template.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- a
|
|
11
|
-
-
|
|
12
|
-
- the
|
|
8
|
+
1. check or add the interfaces in [interfaces.ts](mdc:admin-sdk/src/interfaces.ts).ts file
|
|
9
|
+
2. Standard Parts of query file:
|
|
10
|
+
- a QueryKey Function
|
|
11
|
+
- a Setter function
|
|
12
|
+
- the function to interact with the api
|
|
13
|
+
- the react-query hook to use the function
|
|
13
14
|
|
|
14
|
-
Single Query Example: [useGetAccount.ts](mdc:src/queries/accounts/useGetAccount.ts)
|
|
15
|
-
Infinite Query Example: [useGetAccounts.ts](mdc:src/queries/accounts/useGetAccounts.ts)
|
|
15
|
+
Single Query Example: [useGetAccount.ts](mdc:admin-web/src/queries/accounts/useGetAccount.ts)
|
|
16
|
+
Infinite Query Example: [useGetAccounts.ts](mdc:admin-web/src/queries/accounts/useGetAccounts.ts)
|