@alevnyacow/nzmt 0.29.0 → 0.30.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/bin/cli.js +4 -4
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -1096,7 +1096,7 @@ function generateController(upperCase, lowerCase, crudService) {
|
|
|
1096
1096
|
`\t\t\tresponse: ${crudServiceLowercase}Metadata.schemas.update.response`,
|
|
1097
1097
|
`\t\t},`,
|
|
1098
1098
|
`\t\tDELETE: {`,
|
|
1099
|
-
`\t\t\tquery: ${crudServiceLowercase}Metadata.schemas.delete.payload,`,
|
|
1099
|
+
`\t\t\tquery: ${crudServiceLowercase}Metadata.schemas.delete.payload.shape.filter,`,
|
|
1100
1100
|
`\t\t\tresponse: ${crudServiceLowercase}Metadata.schemas.delete.response`,
|
|
1101
1101
|
`\t\t},`,
|
|
1102
1102
|
`\t}`,
|
|
@@ -1144,7 +1144,7 @@ function generateController(upperCase, lowerCase, crudService) {
|
|
|
1144
1144
|
``,
|
|
1145
1145
|
`\tPOST = this.endpoints('POST', this.${crudServiceLowercase}.create)`,
|
|
1146
1146
|
`\tPATCH = this.endpoints('PATCH', this.${crudServiceLowercase}.update)`,
|
|
1147
|
-
`\tDELETE = this.endpoints('DELETE', this.${crudServiceLowercase}.delete)`,
|
|
1147
|
+
`\tDELETE = this.endpoints('DELETE', (filter) => this.${crudServiceLowercase}.delete({ filter }))`,
|
|
1148
1148
|
].join('\n') : undefined,
|
|
1149
1149
|
`}`
|
|
1150
1150
|
].filter(x => typeof x === 'string').join('\n'))
|
|
@@ -1269,7 +1269,7 @@ function generateQueries(lowerCase, upperCase, entity) {
|
|
|
1269
1269
|
fs.writeFileSync(fileName, [
|
|
1270
1270
|
`import { ${rootMethod === 'GET' ? 'useQuery' : 'useMutation, useQueryClient'} } from '@tanstack/react-query'`,
|
|
1271
1271
|
`import type { ${upperCase}API } from '@${config.paths.controllers}/${requiredEntity}'`,
|
|
1272
|
-
`import { apiRequest, normalizeObjectKeysOrder } from '@${config.paths.clientUtils}'`,
|
|
1272
|
+
`import { apiRequest${rootMethod === 'GET' ? ', normalizeObjectKeysOrder' : ''} } from '@${config.paths.clientUtils}'`,
|
|
1273
1273
|
'',
|
|
1274
1274
|
`type Method = ${upperCase}API['endpoints']['${rootMethod}']`,
|
|
1275
1275
|
``,
|
|
@@ -1311,7 +1311,7 @@ function generateQueries(lowerCase, upperCase, entity) {
|
|
|
1311
1311
|
fs.writeFileSync(fileName, [
|
|
1312
1312
|
`import { ${method === 'GET' ? 'useQuery' : 'useMutation, useQueryClient' } } from '@tanstack/react-query'`,
|
|
1313
1313
|
`import type { ${upperCase}API } from '@${config.paths.controllers}/${requiredEntity}'`,
|
|
1314
|
-
`import { apiRequest, normalizeObjectKeysOrder } from '@${config.paths.clientUtils}'`,
|
|
1314
|
+
`import { apiRequest${method === 'GET' ? ', normalizeObjectKeysOrder' : ''} } from '@${config.paths.clientUtils}'`,
|
|
1315
1315
|
'',
|
|
1316
1316
|
`type Method = ${upperCase}API['endpoints']['${fullMethodName}']`,
|
|
1317
1317
|
``,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alevnyacow/nzmt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Next Zod Modules Toolkit",
|
|
5
5
|
"keywords": ["next", "full-stack", "server", "backend", "cli", "scaffolding", "zod", "rest", "contract programming", "contract-first", "react-query", "ddd", "domain-driven"],
|
|
6
6
|
"repository": {
|