@wzyjs/next 0.3.10 → 0.3.17
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.
|
@@ -11,6 +11,9 @@ import type { UseTRPCQueryOptions } from '@trpc/react-query/shared'
|
|
|
11
11
|
type FindManyArgs = Prisma.HabitGroupFindManyArgs;
|
|
12
12
|
type FindUniqueArgs = Prisma.HabitGroupFindUniqueArgs;
|
|
13
13
|
type GetPayload<T extends FindManyArgs | FindUniqueArgs> = Prisma.HabitGroupGetPayload<T>;
|
|
14
|
+
type TagsQuery = {
|
|
15
|
+
where?: FindManyArgs['where']
|
|
16
|
+
}
|
|
14
17
|
|
|
15
18
|
// 定义 SelectSubset 类型
|
|
16
19
|
type SelectSubset<T extends FindManyArgs | FindUniqueArgs, A> = Prisma.SelectSubset<T, A>;
|
|
@@ -28,7 +31,7 @@ interface Option<TList extends FindManyArgs = FindManyArgs, TInfo extends FindUn
|
|
|
28
31
|
option?: UseOptions<GetPayload<TInfo> | null>
|
|
29
32
|
}
|
|
30
33
|
tags?: true | {
|
|
31
|
-
query?:
|
|
34
|
+
query?: TagsQuery
|
|
32
35
|
option?: UseOptions<string[]>
|
|
33
36
|
}
|
|
34
37
|
create?: Parameters<typeof api.habitGroup.create.useMutation>[0]
|
|
@@ -71,11 +74,11 @@ export const useHabitGroupCRUD = <TList extends FindManyArgs = FindManyArgs, TIn
|
|
|
71
74
|
|
|
72
75
|
const tagsConfig: Option['tags'] | false = tags
|
|
73
76
|
const tagsEnabled: boolean = Boolean(tagsConfig)
|
|
74
|
-
const tagsQuery:
|
|
77
|
+
const tagsQuery: TagsQuery | undefined = (
|
|
75
78
|
tagsConfig && typeof tagsConfig === 'object' ? tagsConfig.query : undefined
|
|
76
|
-
)
|
|
79
|
+
)
|
|
77
80
|
|
|
78
|
-
const tagsState = api.habitGroup.getAllTags.useQuery(tagsQuery, {
|
|
81
|
+
const tagsState = api.habitGroup.getAllTags.useQuery(tagsQuery as any, {
|
|
79
82
|
enabled: tagsEnabled,
|
|
80
83
|
...(tagsConfig && typeof tagsConfig === 'object' ? tagsConfig.option : undefined),
|
|
81
84
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wzyjs/next",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"description": "description",
|
|
5
5
|
"author": "wzy",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@zenstackhq/sdk": "^2.12.3"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "2b3434df547bcd524ee9afd17773d6b789cbe2b2",
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
}
|