@jetthai/cuora 1.1.451-dev.2 → 1.1.451

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.
@@ -99,7 +99,6 @@ export default function (request, context) {
99
99
  target: 'debouncing',
100
100
  actions: 'setPromotion',
101
101
  internal: false,
102
- cond: 'isPromotionChanged',
103
102
  },
104
103
  INPUT_AMOUNT: {
105
104
  target: 'debouncing',
@@ -121,7 +120,7 @@ export default function (request, context) {
121
120
  currentPayment,
122
121
  method: currentPayment.method,
123
122
  processing,
124
- selectedAmount: max(context.promotion?.minimumAmount, currentPayment?.minimum, context.selectedAmount, 0),
123
+ selectedAmount: max(promotion?.minimumAmount, currentPayment?.minimum, selectedAmount, 0),
125
124
  virtualBanks,
126
125
  }
127
126
  }),
@@ -159,15 +158,10 @@ export default function (request, context) {
159
158
  setPromotion: assign((context, event) => {
160
159
  return {
161
160
  promotion: event.data,
162
- selectedAmount: max(event.data?.minimumAmount, context.currentPayment?.minimum, 0),
163
- calculation: null,
164
161
  }
165
162
  }),
166
163
  },
167
164
  guards: {
168
- isPromotionChanged: (context, event) => {
169
- return event.data?.promotionsNo !== context.promotion?.promotionsNo
170
- },
171
165
  isCalculable: (context, event) => {
172
166
  const {
173
167
  selectedAmount,
@@ -86,27 +86,12 @@ export default function (request) {
86
86
  return { fc }
87
87
  }),
88
88
  setSignUpId: assign((context, event) => {
89
- const {
90
- email,
91
- username,
92
- nick_name,
93
- password,
94
- countryCode,
95
- phone,
96
- bankCode,
97
- bankAccount,
98
- holderName,
99
- branch,
100
- branchCode,
101
- affiliateCode,
102
- birthday,
103
- } = event.data
89
+ const { email, username, nick_name, password, countryCode, phone, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } =
90
+ event.data
104
91
  return {
105
92
  signUpData: {
106
93
  provider: 'local',
107
- birthday,
108
94
  ...pickBindData(event.data),
109
- birthday,
110
95
  email,
111
96
  username,
112
97
  nick_name,
@@ -123,14 +108,11 @@ export default function (request) {
123
108
  }
124
109
  }),
125
110
  setSignUpPhone: assign((context, event) => {
126
- const { email, countryCode, phone, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode, birthday } =
127
- event.data
111
+ const { email, countryCode, phone, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
128
112
  return {
129
113
  signUpData: {
130
114
  provider: 'phone',
131
- birthday,
132
115
  ...pickBindData(event.data),
133
- birthday,
134
116
  email,
135
117
  countryCode,
136
118
  phone,
@@ -146,14 +128,11 @@ export default function (request) {
146
128
  }
147
129
  }),
148
130
  setSignUpEmail: assign((context, event) => {
149
- const { email, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode, countryCode, phone, birthday } =
150
- event.data
131
+ const { email, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode, countryCode, phone } = event.data
151
132
  return {
152
133
  signUpData: {
153
134
  provider: 'email',
154
- birthday,
155
135
  ...pickBindData(event.data),
156
- birthday,
157
136
  email,
158
137
  nick_name,
159
138
  password,
@@ -254,7 +254,7 @@ export default class Request {
254
254
  // reject → onError → leaving → 乾淨登出,且一樣不送網路 → 洪水照止
255
255
  if (!req.isPublic && !this.getToken()) return Promise.reject({ code: 'ERR_A103' })
256
256
 
257
- const cancelToken = customToken
257
+ const cancelToken = customToken || this.source.token
258
258
 
259
259
  // ERR_A103 No token provided 改由後端回傳:不再於送出前自行 throw,
260
260
  const requestConfig = this._createConfig(req, cancelToken)
@@ -283,8 +283,6 @@ export default class Request {
283
283
  }
284
284
  }
285
285
 
286
- // 注意:send() 已不再預設附加 this.source.token(見 send 內註解),
287
- // sourceUpdate 僅對「呼叫端明確以 this.source.token 為 customToken」的請求有效;保留以維持 API 相容。
288
286
  sourceUpdate() {
289
287
  this.source.cancel('Requests Cancelled')
290
288
  this.source = this.axios.CancelToken.source()