Skip to content

Commit 3cfb676

Browse files
committed
chore: return custom slgify back
1 parent 143bcf6 commit 3cfb676

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/pages/signup-affiliates/utils/_utils.tsx

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
import { Analytics, TEvents } from '@deriv-com/analytics'
22
import { SubmitTypes } from '../_types'
33

4+
const customSlugify = (text: string): string => {
5+
const charMap: { [key: string]: string } = {
6+
ə: 'e',
7+
'(': ' ',
8+
')': ' ',
9+
// Add other special characters and their mappings here if needed
10+
}
11+
return text
12+
.toString()
13+
.split('')
14+
.map((char) => charMap[char] || char)
15+
.join('')
16+
.normalize('NFD')
17+
.replace(/[\u0300-\u036f]/g, '')
18+
.trim()
19+
.replace(/'/g, '')
20+
.replace(/--+/g, '-')
21+
}
22+
423
export const Submit = ({
524
is_online,
625
affiliate_account,
@@ -22,7 +41,7 @@ export const Submit = ({
2241
country: affiliate_account.account_address.country.symbol,
2342
address_city: affiliate_account.account_address.city.trim(),
2443
address_postcode: affiliate_account.account_address.postal_code.trim(),
25-
address_state: affiliate_account.account_address.state.symbol,
44+
address_state: customSlugify(affiliate_account.account_address.state.name),
2645
address_street: affiliate_account.account_address.street.trim(),
2746
first_name: affiliate_account.account_details.first_name.trim(),
2847
last_name: affiliate_account.account_details.last_name.trim(),

0 commit comments

Comments
 (0)