Commit 3cfb676 1 parent 143bcf6 commit 3cfb676 Copy full SHA for 3cfb676
File tree 1 file changed +20
-1
lines changed
src/pages/signup-affiliates/utils
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { Analytics , TEvents } from '@deriv-com/analytics'
2
2
import { SubmitTypes } from '../_types'
3
3
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
+
4
23
export const Submit = ( {
5
24
is_online,
6
25
affiliate_account,
@@ -22,7 +41,7 @@ export const Submit = ({
22
41
country : affiliate_account . account_address . country . symbol ,
23
42
address_city : affiliate_account . account_address . city . trim ( ) ,
24
43
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 ) ,
26
45
address_street : affiliate_account . account_address . street . trim ( ) ,
27
46
first_name : affiliate_account . account_details . first_name . trim ( ) ,
28
47
last_name : affiliate_account . account_details . last_name . trim ( ) ,
You can’t perform that action at this time.
0 commit comments