@wzyjs/next 0.2.62 → 0.2.64

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/dist/Base.zmodel CHANGED
@@ -7,7 +7,7 @@ generator json {
7
7
  }
8
8
 
9
9
  datasource db {
10
- provider = "mysql"
10
+ provider = "postgresql"
11
11
  url = env("DATABASE_URL")
12
12
  }
13
13
 
@@ -1,5 +1,3 @@
1
- import React, { useState } from 'react'
2
-
3
1
  // @ts-ignore
4
2
  import { message } from '@/components'
5
3
 
@@ -29,6 +27,7 @@ interface Option<TList extends FindManyArgs = FindManyArgs, TInfo extends FindUn
29
27
  query: SelectSubset<TInfo, FindUniqueArgs>
30
28
  option?: UseOptions<GetPayload<TInfo> | null>
31
29
  }
30
+ allTags?: true
32
31
  create?: Parameters<typeof api.habitGroup.create.useMutation>[0]
33
32
  update?: Parameters<typeof api.habitGroup.update.useMutation>[0]
34
33
  remove?: Parameters<typeof api.habitGroup.update.useMutation>[0]
@@ -42,11 +41,13 @@ const r = (q: any) => {
42
41
  const query = JSON.parse(JSON.stringify(q))
43
42
  delete query?.skip
44
43
  delete query?.take
44
+ delete query?.include
45
+ delete query?.select
45
46
  return query
46
47
  }
47
48
 
48
49
  export const useHabitGroupCRUD = <TList extends FindManyArgs = FindManyArgs, TInfo extends FindUniqueArgs = FindUniqueArgs>(option: Option<TList, TInfo> = {}) => {
49
- const { list, info, create, update, remove, delete: deleteOption, showTip = true } = option
50
+ const { list, info, create, update, remove, allTags = false, delete: deleteOption, showTip = true } = option
50
51
 
51
52
  const apiUtils = api.useUtils()
52
53
 
@@ -65,6 +66,10 @@ export const useHabitGroupCRUD = <TList extends FindManyArgs = FindManyArgs, TIn
65
66
  ...(info ? info.option : undefined),
66
67
  })
67
68
 
69
+ const allTagsState = api.habitGroup.getAllTags.useQuery(undefined, {
70
+ enabled: allTags,
71
+ })
72
+
68
73
  const onSuccess = (tip: string) => {
69
74
  message.destroy()
70
75
  if (showTip) {
@@ -172,15 +177,17 @@ export const useHabitGroupCRUD = <TList extends FindManyArgs = FindManyArgs, TIn
172
177
  },
173
178
  }
174
179
 
175
- const [query, setQuery] = useState()
176
-
177
180
  return {
178
181
  listState,
179
182
  countState,
183
+
180
184
  infoState,
185
+
186
+ allTagsState,
187
+
181
188
  createState,
182
- removeState,
183
189
  updateState,
190
+ removeState,
184
191
  deleteState,
185
192
 
186
193
  apiUtils,
@@ -43,9 +43,10 @@ var generateTags = function (model, outputPath) { return __awaiter(void 0, void
43
43
  var dataModels, modelsWithTags, _i, modelsWithTags_1, dataModel, modelName, routerFilePath, fileContent, getAllTagsInterface, lastCommaIndex, closingBraceIndex, beforeInsertion, afterInsertion, newContent;
44
44
  return __generator(this, function (_a) {
45
45
  dataModels = model.declarations.filter(function (item) { return item.$type === 'DataModel'; });
46
- modelsWithTags = dataModels.filter(function (dataModel) {
47
- return dataModel.fields.some(function (field) { return field.name === 'tags'; });
48
- });
46
+ modelsWithTags = dataModels;
47
+ // .filter(dataModel => {
48
+ // return dataModel.fields.some(field => field.name === 'tags')
49
+ // })
49
50
  if (modelsWithTags.length === 0) {
50
51
  return [2 /*return*/];
51
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wzyjs/next",
3
- "version": "0.2.62",
3
+ "version": "0.2.64",
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": "d9493fc26e494769edcb3aab4d193e5d7ab68bc1",
20
+ "gitHead": "b04da8a500c4be43d8264efe4e904f954fe1bb82",
21
21
  "publishConfig": {
22
22
  "access": "public"
23
23
  }