payment-kit 1.13.156 → 1.13.157

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.
@@ -163,7 +163,7 @@ router.get('/search', auth, async (req, res) => {
163
163
  }
164
164
  // fix here https://github.com/blocklet/payment-kit/issues/394
165
165
  const { rows: list1, count: count1 } = await Subscription.findAndCountAll({
166
- where: where[0],
166
+ where: q ? where[0] : where,
167
167
  order: [['created_at', 'DESC']],
168
168
  offset: (page - 1) * pageSize,
169
169
  limit: pageSize,
@@ -176,21 +176,26 @@ router.get('/search', auth, async (req, res) => {
176
176
  ],
177
177
  });
178
178
 
179
- const { rows: list2, count: count2 } = await Subscription.findAndCountAll({
180
- order: [['created_at', 'DESC']],
181
- offset: (page - 1) * pageSize,
182
- limit: pageSize,
183
- distinct: true,
184
- include: [
185
- { model: Customer, as: 'customer', where: where[1] },
186
- { model: PaymentCurrency, as: 'paymentCurrency' },
187
- { model: PaymentMethod, as: 'paymentMethod' },
188
- { model: SubscriptionItem, as: 'items' },
189
- ],
190
- });
179
+ let count = count1;
180
+ let list = list1;
181
+
182
+ if (q) {
183
+ const { rows: list2, count: count2 } = await Subscription.findAndCountAll({
184
+ order: [['created_at', 'DESC']],
185
+ offset: (page - 1) * pageSize,
186
+ limit: pageSize,
187
+ distinct: true,
188
+ include: [
189
+ { model: Customer, as: 'customer', where: where[1] },
190
+ { model: PaymentCurrency, as: 'paymentCurrency' },
191
+ { model: PaymentMethod, as: 'paymentMethod' },
192
+ { model: SubscriptionItem, as: 'items' },
193
+ ],
194
+ });
191
195
 
192
- const count = count1 + count2;
193
- const list = list1.concat(list2);
196
+ count = count1 + count2;
197
+ list = list1.concat(list2 || []);
198
+ }
194
199
 
195
200
  res.json({ count, list });
196
201
  });
package/blocklet.yml CHANGED
@@ -14,7 +14,7 @@ repository:
14
14
  type: git
15
15
  url: git+https://github.com/blocklet/payment-kit.git
16
16
  specVersion: 1.2.8
17
- version: 1.13.156
17
+ version: 1.13.157
18
18
  logo: logo.png
19
19
  files:
20
20
  - dist
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payment-kit",
3
- "version": "1.13.156",
3
+ "version": "1.13.157",
4
4
  "scripts": {
5
5
  "dev": "cross-env COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev --open",
6
6
  "eject": "vite eject",
@@ -50,7 +50,7 @@
50
50
  "@arcblock/jwt": "^1.18.110",
51
51
  "@arcblock/ux": "^2.9.29",
52
52
  "@blocklet/logger": "1.16.23",
53
- "@blocklet/payment-react": "1.13.156",
53
+ "@blocklet/payment-react": "1.13.157",
54
54
  "@blocklet/sdk": "1.16.23",
55
55
  "@blocklet/ui-react": "^2.9.29",
56
56
  "@blocklet/uploader": "^0.0.73",
@@ -110,7 +110,7 @@
110
110
  "devDependencies": {
111
111
  "@abtnode/types": "1.16.23",
112
112
  "@arcblock/eslint-config-ts": "^0.2.4",
113
- "@blocklet/payment-types": "1.13.156",
113
+ "@blocklet/payment-types": "1.13.157",
114
114
  "@types/cookie-parser": "^1.4.6",
115
115
  "@types/cors": "^2.8.17",
116
116
  "@types/dotenv-flow": "^3.3.3",
@@ -149,5 +149,5 @@
149
149
  "parser": "typescript"
150
150
  }
151
151
  },
152
- "gitHead": "88f9908f07e00a0958472c9399f427d96d91b2c4"
152
+ "gitHead": "8764322e8013a37f6cf9c6843ef7701f2bddc412"
153
153
  }