@jetthai/cuora 1.1.155 → 1.1.156

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,8 @@
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.156](https://github.com/jetthai/cuora-module/compare/v1.1.155...v1.1.156) (2023-08-07)
6
+
5
7
  ### [1.1.155](https://github.com/jetthai/cuora-module/compare/v1.1.154...v1.1.155) (2023-08-02)
6
8
 
7
9
  ### [1.1.154](https://github.com/jetthai/cuora-module/compare/v1.1.153...v1.1.154) (2023-08-01)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.155",
3
+ "version": "1.1.156",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -141,14 +141,17 @@ export default function (request) {
141
141
  },
142
142
  fetchActivityDetailList: async (context, event) => {
143
143
  await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
144
+ const hasToken = request.getToken()
144
145
 
145
146
  const { activityList = [], detailNeededActivityTypes } = context
146
147
  const filteredActivityList = activityList.filter((activity) => detailNeededActivityTypes.includes(activity.activityType))
147
- return await Promise.all(
148
- filteredActivityList.map((item) => {
149
- return request.send(activity.getActivityDetail({ activityNo: item.activityNo, appSecret }))
150
- })
151
- )
148
+ return hasToken
149
+ ? await Promise.all(
150
+ filteredActivityList.map((item) => {
151
+ return request.send(activity.getActivityDetail({ activityNo: item.activityNo, appSecret }))
152
+ })
153
+ )
154
+ : []
152
155
  },
153
156
  },
154
157
  }