@jetthai/cuora 1.1.243 → 1.1.244

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.244](https://github.com/jetthai/cuora-module/compare/v1.1.243...v1.1.244) (2024-04-09)
6
+
5
7
  ### [1.1.243](https://github.com/jetthai/cuora-module/compare/v1.1.242...v1.1.243) (2024-04-02)
6
8
 
7
9
  ### [1.1.242](https://github.com/jetthai/cuora-module/compare/v1.1.241...v1.1.242) (2024-04-02)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.243",
3
+ "version": "1.1.244",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -51,7 +51,7 @@ export default function (request) {
51
51
  src: 'fetchGamesByProvider',
52
52
  onDone: {
53
53
  target: 'idle',
54
- actions: 'setGames',
54
+ actions: 'setGamesByProvider',
55
55
  },
56
56
  onError: {
57
57
  target: 'fail',
@@ -228,6 +228,13 @@ export default function (request) {
228
228
  lang: event.data.lang,
229
229
  }
230
230
  }),
231
+ setGamesByProvider: assign((context, event) => {
232
+ const { gameList, tagList } = event.data
233
+ return {
234
+ tagList,
235
+ gameList,
236
+ }
237
+ }),
231
238
  clearKeyword: assign((context, event) => {
232
239
  return {
233
240
  keyword: '',
@@ -251,6 +258,8 @@ export default function (request) {
251
258
  setProviderName: assign((context, event) => {
252
259
  return {
253
260
  providerName: event.data.providerName,
261
+ keyword: event.data.keyword,
262
+ lang: event.data.lang,
254
263
  }
255
264
  }),
256
265
  },
@@ -300,13 +309,24 @@ export default function (request) {
300
309
  return { traceId, gameList: result }
301
310
  },
302
311
  fetchGamesByProvider: async (context, event) => {
303
- const { providerName } = context
304
- const { traceId, result } = await request.send(
305
- game.getGameSearchList({
306
- providerName: providerName,
307
- })
308
- )
309
- return { traceId, gameList: result }
312
+ const { providerName, keyword, lang } = context
313
+ const [games, tags] = await Promise.all([
314
+ request.send(
315
+ game.getGameSearchList({
316
+ providerName: providerName,
317
+ })
318
+ ),
319
+ request.send(
320
+ game.getGameTags({
321
+ q: keyword,
322
+ lang,
323
+ })
324
+ ),
325
+ ])
326
+ return {
327
+ gameList: games.result,
328
+ tagList: tags.result,
329
+ }
310
330
  },
311
331
  fetchGamesByKeyword: async (context, event) => {
312
332
  const { keyword, click, clickDefault, lang } = context