@jetthai/cuora 1.1.136 → 1.1.138

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.138](https://github.com/jetthai/cuora-module/compare/v1.1.137...v1.1.138) (2023-07-14)
6
+
7
+ ### [1.1.137](https://github.com/jetthai/cuora-module/compare/v1.1.136...v1.1.137) (2023-07-14)
8
+
5
9
  ### [1.1.136](https://github.com/jetthai/cuora-module/compare/v1.1.135...v1.1.136) (2023-07-14)
6
10
 
7
11
  ### [1.1.135](https://github.com/jetthai/cuora-module/compare/v1.1.134...v1.1.135) (2023-07-12)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.136",
3
+ "version": "1.1.138",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -103,11 +103,11 @@ export default function (request) {
103
103
  },
104
104
  services: {
105
105
  fetchList: async (context, event) => {
106
- const { data } = await request.send(activity.getActivityList({ appSecret }))
107
- let promotionList = []
108
- if (request.getToken()) {
109
- promotionList = await request.send(payment.getPromotionsList())
110
- }
106
+ const hasToken = request.getToken()
107
+ const [{ data }, promotionList] = await Promise.all([
108
+ request.send(activity.getActivityList({ appSecret })),
109
+ hasToken ? request.send(payment.getPromotionsList()) : [],
110
+ ])
111
111
 
112
112
  return { activityList: data, promotionList }
113
113
  },