dn-react-router-toolkit 0.7.3 → 0.7.4

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.
@@ -112,21 +112,23 @@ function apiHandler({
112
112
  ).filter(
113
113
  (key) => Object.prototype.hasOwnProperty.call(params, key)
114
114
  );
115
- const where = (0, import_drizzle_orm.and)(
116
- ...paramsForExistenceCheck.reduce((acc, key) => {
117
- const condition = existingConditions[key];
118
- if (condition) {
119
- acc.push(condition(params[key]));
120
- }
121
- return acc;
122
- }, [])
123
- );
124
- const existing = await repository.findAll({
125
- limit: 1,
126
- where
127
- });
128
- if (existing.length > 0) {
129
- throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
115
+ if (paramsForExistenceCheck.length > 0) {
116
+ const where = (0, import_drizzle_orm.and)(
117
+ ...paramsForExistenceCheck.reduce((acc, key) => {
118
+ const condition = existingConditions[key];
119
+ if (condition) {
120
+ acc.push(condition(params[key]));
121
+ }
122
+ return acc;
123
+ }, [])
124
+ );
125
+ const existing = await repository.findAll({
126
+ limit: 1,
127
+ where
128
+ });
129
+ if (existing.length > 0) {
130
+ throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
131
+ }
130
132
  }
131
133
  }
132
134
  const values = {
@@ -98,21 +98,23 @@ function apiHandler({
98
98
  ).filter(
99
99
  (key) => Object.prototype.hasOwnProperty.call(params, key)
100
100
  );
101
- const where = and(
102
- ...paramsForExistenceCheck.reduce((acc, key) => {
103
- const condition = existingConditions[key];
104
- if (condition) {
105
- acc.push(condition(params[key]));
106
- }
107
- return acc;
108
- }, [])
109
- );
110
- const existing = await repository.findAll({
111
- limit: 1,
112
- where
113
- });
114
- if (existing.length > 0) {
115
- throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
101
+ if (paramsForExistenceCheck.length > 0) {
102
+ const where = and(
103
+ ...paramsForExistenceCheck.reduce((acc, key) => {
104
+ const condition = existingConditions[key];
105
+ if (condition) {
106
+ acc.push(condition(params[key]));
107
+ }
108
+ return acc;
109
+ }, [])
110
+ );
111
+ const existing = await repository.findAll({
112
+ limit: 1,
113
+ where
114
+ });
115
+ if (existing.length > 0) {
116
+ throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
117
+ }
116
118
  }
117
119
  }
118
120
  const values = {
@@ -173,21 +173,23 @@ function apiHandler({
173
173
  ).filter(
174
174
  (key) => Object.prototype.hasOwnProperty.call(params, key)
175
175
  );
176
- const where = (0, import_drizzle_orm2.and)(
177
- ...paramsForExistenceCheck.reduce((acc, key) => {
178
- const condition = existingConditions[key];
179
- if (condition) {
180
- acc.push(condition(params[key]));
181
- }
182
- return acc;
183
- }, [])
184
- );
185
- const existing = await repository.findAll({
186
- limit: 1,
187
- where
188
- });
189
- if (existing.length > 0) {
190
- throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
176
+ if (paramsForExistenceCheck.length > 0) {
177
+ const where = (0, import_drizzle_orm2.and)(
178
+ ...paramsForExistenceCheck.reduce((acc, key) => {
179
+ const condition = existingConditions[key];
180
+ if (condition) {
181
+ acc.push(condition(params[key]));
182
+ }
183
+ return acc;
184
+ }, [])
185
+ );
186
+ const existing = await repository.findAll({
187
+ limit: 1,
188
+ where
189
+ });
190
+ if (existing.length > 0) {
191
+ throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
192
+ }
191
193
  }
192
194
  }
193
195
  const values = {
@@ -160,21 +160,23 @@ function apiHandler({
160
160
  ).filter(
161
161
  (key) => Object.prototype.hasOwnProperty.call(params, key)
162
162
  );
163
- const where = and2(
164
- ...paramsForExistenceCheck.reduce((acc, key) => {
165
- const condition = existingConditions[key];
166
- if (condition) {
167
- acc.push(condition(params[key]));
168
- }
169
- return acc;
170
- }, [])
171
- );
172
- const existing = await repository.findAll({
173
- limit: 1,
174
- where
175
- });
176
- if (existing.length > 0) {
177
- throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
163
+ if (paramsForExistenceCheck.length > 0) {
164
+ const where = and2(
165
+ ...paramsForExistenceCheck.reduce((acc, key) => {
166
+ const condition = existingConditions[key];
167
+ if (condition) {
168
+ acc.push(condition(params[key]));
169
+ }
170
+ return acc;
171
+ }, [])
172
+ );
173
+ const existing = await repository.findAll({
174
+ limit: 1,
175
+ where
176
+ });
177
+ if (existing.length > 0) {
178
+ throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
179
+ }
178
180
  }
179
181
  }
180
182
  const values = {
@@ -8077,21 +8077,23 @@ function apiHandler({
8077
8077
  ).filter(
8078
8078
  (key) => Object.prototype.hasOwnProperty.call(params, key)
8079
8079
  );
8080
- const where = (0, import_drizzle_orm2.and)(
8081
- ...paramsForExistenceCheck.reduce((acc, key) => {
8082
- const condition = existingConditions[key];
8083
- if (condition) {
8084
- acc.push(condition(params[key]));
8085
- }
8086
- return acc;
8087
- }, [])
8088
- );
8089
- const existing = await repository.findAll({
8090
- limit: 1,
8091
- where
8092
- });
8093
- if (existing.length > 0) {
8094
- throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
8080
+ if (paramsForExistenceCheck.length > 0) {
8081
+ const where = (0, import_drizzle_orm2.and)(
8082
+ ...paramsForExistenceCheck.reduce((acc, key) => {
8083
+ const condition = existingConditions[key];
8084
+ if (condition) {
8085
+ acc.push(condition(params[key]));
8086
+ }
8087
+ return acc;
8088
+ }, [])
8089
+ );
8090
+ const existing = await repository.findAll({
8091
+ limit: 1,
8092
+ where
8093
+ });
8094
+ if (existing.length > 0) {
8095
+ throw (0, import_http.CONFLICT)("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
8096
+ }
8095
8097
  }
8096
8098
  }
8097
8099
  const values = {
@@ -8073,21 +8073,23 @@ function apiHandler({
8073
8073
  ).filter(
8074
8074
  (key) => Object.prototype.hasOwnProperty.call(params, key)
8075
8075
  );
8076
- const where = and2(
8077
- ...paramsForExistenceCheck.reduce((acc, key) => {
8078
- const condition = existingConditions[key];
8079
- if (condition) {
8080
- acc.push(condition(params[key]));
8081
- }
8082
- return acc;
8083
- }, [])
8084
- );
8085
- const existing = await repository.findAll({
8086
- limit: 1,
8087
- where
8088
- });
8089
- if (existing.length > 0) {
8090
- throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
8076
+ if (paramsForExistenceCheck.length > 0) {
8077
+ const where = and2(
8078
+ ...paramsForExistenceCheck.reduce((acc, key) => {
8079
+ const condition = existingConditions[key];
8080
+ if (condition) {
8081
+ acc.push(condition(params[key]));
8082
+ }
8083
+ return acc;
8084
+ }, [])
8085
+ );
8086
+ const existing = await repository.findAll({
8087
+ limit: 1,
8088
+ where
8089
+ });
8090
+ if (existing.length > 0) {
8091
+ throw CONFLICT("\uC790\uB8CC\uAC00 \uC774\uBBF8 \uC874\uC7AC\uD569\uB2C8\uB2E4.");
8092
+ }
8091
8093
  }
8092
8094
  }
8093
8095
  const values = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dn-react-router-toolkit",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.js",