@jetthai/cuora 1.1.244 → 1.1.246

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.246](https://github.com/jetthai/cuora-module/compare/v1.1.245...v1.1.246) (2024-04-12)
6
+
7
+ ### [1.1.245](https://github.com/jetthai/cuora-module/compare/v1.1.244...v1.1.245) (2024-04-11)
8
+
5
9
  ### [1.1.244](https://github.com/jetthai/cuora-module/compare/v1.1.243...v1.1.244) (2024-04-09)
6
10
 
7
11
  ### [1.1.243](https://github.com/jetthai/cuora-module/compare/v1.1.242...v1.1.243) (2024-04-02)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.244",
3
+ "version": "1.1.246",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/auth.js CHANGED
@@ -54,5 +54,10 @@ export default {
54
54
  method: 'post',
55
55
  params: { provider, countryCode, phone, email },
56
56
  }),
57
- checkAccount: ({ account, strategy }) => ({ url: 'checkAccount', method: 'post', params: { account, strategy }, isPublic: true }),
57
+ checkAccount: ({ account, nick_name, strategy }) => ({
58
+ url: 'checkAccount',
59
+ method: 'post',
60
+ params: { account, nick_name, strategy },
61
+ isPublic: true,
62
+ }),
58
63
  }
@@ -9,11 +9,11 @@ const messageState = {
9
9
  initial: 'hidden',
10
10
  states: {
11
11
  hidden: {},
12
- delecting: {
12
+ deleting: {
13
13
  invoke: {
14
14
  src: 'deleteMessages',
15
15
  onDone: {
16
- target: 'delected',
16
+ target: 'deleted',
17
17
  actions: 'removeMessage',
18
18
  },
19
19
  onError: {
@@ -21,7 +21,9 @@ const messageState = {
21
21
  },
22
22
  },
23
23
  },
24
- delected: {},
24
+ deleted: {
25
+ entry: ['cancelSelectMessages', 'hideMessage'],
26
+ },
25
27
  shown: {
26
28
  on: {
27
29
  HIDE_MESSAGE: {
@@ -56,7 +58,7 @@ const messageState = {
56
58
  actions: ['selectMessages', 'setDelectMessages'],
57
59
  },
58
60
  DELETE_MESSAGES: {
59
- target: '.delecting',
61
+ target: '.deleting',
60
62
  },
61
63
  },
62
64
  },
@@ -235,6 +237,9 @@ export default function (request) {
235
237
  target: '.sending',
236
238
  cond: 'isSendable',
237
239
  },
240
+ CANCEL_SELECT: {
241
+ actions: 'cancelSelectMessages',
242
+ },
238
243
  CLEAR: {
239
244
  actions: 'hideMessage',
240
245
  },
@@ -287,7 +292,12 @@ export default function (request) {
287
292
  setTabs: assign((context, event) => {
288
293
  let { currentTab } = context
289
294
  if (!currentTab) {
290
- currentTab = event.data?.[0]
295
+ const customerTab = event.data?.find((tab) => tab === 'CUSTOMER')
296
+ if (!!customerTab) {
297
+ currentTab = 'CUSTOMER'
298
+ } else {
299
+ currentTab = event.data?.[0]
300
+ }
291
301
  }
292
302
  return {
293
303
  tabs: event.data,
@@ -310,6 +320,15 @@ export default function (request) {
310
320
  inbox[currentTab].data = data
311
321
  return { inbox }
312
322
  }),
323
+ cancelSelectMessages: assign((context, event) => {
324
+ const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
325
+ const data = inbox[currentTab].data.map((item) => {
326
+ item.isSelected = false
327
+ return item
328
+ })
329
+ inbox[currentTab].data = data
330
+ return { inbox, selectedDeleteMessages: null }
331
+ }),
313
332
  setDelectMessages: assign((context, event) => {
314
333
  const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
315
334
  const selectedMessages = inbox[currentTab].data?.filter((item) => item.isSelected)
@@ -77,6 +77,7 @@ export default function (request) {
77
77
  setSignUpId: assign((context, event) => {
78
78
  const {
79
79
  username,
80
+ nick_name,
80
81
  password,
81
82
  countryCode,
82
83
  phone,
@@ -93,6 +94,7 @@ export default function (request) {
93
94
  signUpData: {
94
95
  provider: 'local',
95
96
  username,
97
+ nick_name,
96
98
  password,
97
99
  countryCode,
98
100
  phone,
@@ -108,13 +110,26 @@ export default function (request) {
108
110
  }
109
111
  }),
110
112
  setSignUpPhone: assign((context, event) => {
111
- const { countryCode, phone, password, channel, subchannel, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } =
112
- event.data
113
+ const {
114
+ countryCode,
115
+ phone,
116
+ nick_name,
117
+ password,
118
+ channel,
119
+ subchannel,
120
+ bankCode,
121
+ bankAccount,
122
+ holderName,
123
+ branch,
124
+ branchCode,
125
+ affiliateCode,
126
+ } = event.data
113
127
  return {
114
128
  signUpData: {
115
129
  provider: 'phone',
116
130
  countryCode,
117
131
  phone,
132
+ nick_name,
118
133
  password,
119
134
  bankCode,
120
135
  bankAccount,
@@ -128,11 +143,12 @@ export default function (request) {
128
143
  }
129
144
  }),
130
145
  setSignUpEmail: assign((context, event) => {
131
- const { email, password, channel, subchannel, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
146
+ const { email, nick_name, password, channel, subchannel, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
132
147
  return {
133
148
  signUpData: {
134
149
  provider: 'email',
135
150
  email,
151
+ nick_name,
136
152
  password,
137
153
  bankCode,
138
154
  bankAccount,