@jetthai/cuora 1.1.365-v2api-1 → 1.1.365-v2api-2

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.365-v2api-2](https://github.com/jetthai/cuora-module/compare/v1.1.365-v2api-1...v1.1.365-v2api-2) (2025-07-17)
6
+
5
7
  ### [1.1.365-v2api-1](https://github.com/jetthai/cuora-module/compare/v1.1.365...v1.1.365-v2api-1) (2025-07-17)
6
8
 
7
9
  ### [1.1.365](https://github.com/jetthai/cuora-module/compare/v1.1.364...v1.1.365) (2025-07-08)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.365-v2api-1",
3
+ "version": "1.1.365-v2api-2",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -83,7 +83,7 @@ export default {
83
83
  settleAmount: (data) => ({ url: 'activities/exchange/diamond/settle', method: 'post', params: data }),
84
84
  exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
85
85
  collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
86
- getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
86
+ getVipTable: ({ appSecret }) => ({ url: 'activities/viptable', method: 'get', params: { appSecret } }),
87
87
  getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
88
88
  exchangeDiamond: ({ activityNo, exchangeAward = [] }) => ({
89
89
  url: 'activities/exchange/diamond',
@@ -80,7 +80,7 @@ export default function (request) {
80
80
  },
81
81
  services: {
82
82
  fetchHonorBoardList: async (context, event) => {
83
- const { data } = await request.send(activity.getHonorBroadcast(appSecret))
83
+ const { data } = await request.send(activity.getHonorBroadcast({ appSecret }))
84
84
  return data
85
85
  },
86
86
  },
@@ -1,6 +1,7 @@
1
1
  import { assign, createMachine } from 'xstate'
2
2
  import activity from '../api/activity.js'
3
3
  export default function (request) {
4
+ const { appSecret } = request.config
4
5
  return createMachine(
5
6
  {
6
7
  id: 'vip_table',
@@ -35,14 +36,20 @@ export default function (request) {
35
36
  },
36
37
  services: {
37
38
  fetchVipTable: async (context, event) => {
38
- const { viptable = {} } = await request.send(activity.getVipTable())
39
- const { data = [] } = viptable
40
- data.map((item) => {
39
+ const result = await request.send(activity.getVipTable({ appSecret }))
40
+ let dataList = []
41
+ // V2接口轉換中回傳的資料結構不同
42
+ if (!result?.viptable) {
43
+ dataList = result.data
44
+ } else {
45
+ dataList = result.viptable?.data
46
+ }
47
+ dataList.map((item) => {
41
48
  item.title = item.title.toLowerCase()
42
49
  return item
43
50
  })
44
51
 
45
- return data
52
+ return dataList
46
53
  },
47
54
  },
48
55
  }