@jetthai/cuora 1.1.355-dev-2 → 1.1.355-dev-3

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.355-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.355-dev-2...v1.1.355-dev-3) (2025-04-29)
6
+
5
7
  ### [1.1.355-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.355-dev-2) (2025-04-25)
6
8
 
7
9
  ### [1.1.355-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.355-dev-1) (2025-04-25)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.355-dev-2",
3
+ "version": "1.1.355-dev-3",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -4,10 +4,10 @@ import ranking from '../api/ranking.js'
4
4
  export default function (request) {
5
5
  const cycleMapping = ['DAILY', 'WEEKLY', 'MONTHLY']
6
6
 
7
- function roundProcess(rounds) {
7
+ function roundProcess(rounds, cycles) {
8
8
  const roundArrays = rounds.map((round) => Array.from({ length: round }, (_, i) => i + 1))
9
9
  return roundArrays.reduce((acc, roundArray, index) => {
10
- acc[cycleMapping[index]] = roundArray.reverse()
10
+ acc[cycles[index]] = roundArray.reverse()
11
11
  return acc
12
12
  }, {})
13
13
  }
@@ -156,7 +156,8 @@ export default function (request) {
156
156
  // 取得結算週期選單列表
157
157
  const cycleOptions = cycleMapping.slice(0, currentRound.length)
158
158
  // 取得每週期的歷史期數選單列表
159
- const roundOptions = roundProcess(currentRound)
159
+ const cycles = event.data?.rule === 'NORMAL' ? [cycle] : cycleMapping
160
+ const roundOptions = roundProcess(currentRound, cycles)
160
161
  // 如果是月結算,則加入全部選項
161
162
  if (cycle === 'MONTHLY') {
162
163
  cycleOptions.push('ALL')