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