Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
clone_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
clone_excelso
Commits
00dff2ee
Commit
00dff2ee
authored
Aug 25, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Menambahkan validasi di change email
parent
8ad222c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
47 deletions
+55
-47
en.json
lib/en.json
+2
-1
id.json
lib/id.json
+2
-1
ChangeEmail.js
view/ChangeEmail.js
+51
-45
No files found.
lib/en.json
View file @
00dff2ee
...
@@ -228,5 +228,6 @@
...
@@ -228,5 +228,6 @@
"alerConfirmNewPassword"
:
"Password confirmation field is required!"
,
"alerConfirmNewPassword"
:
"Password confirmation field is required!"
,
"alertLabelAddress"
:
"Label field is required"
,
"alertLabelAddress"
:
"Label field is required"
,
"alertDetailAddress"
:
"Detail field is required"
,
"alertDetailAddress"
:
"Detail field is required"
,
"alertVoucher"
:
"Voucher cannot be used with point"
"alertVoucher"
:
"Voucher cannot be used with point"
,
"alertemailblank"
:
"Email cannot be empty"
}
}
\ No newline at end of file
lib/id.json
View file @
00dff2ee
...
@@ -228,5 +228,6 @@
...
@@ -228,5 +228,6 @@
"alerConfirmNewPassword"
:
"Konfirmasi password harus diisi!"
,
"alerConfirmNewPassword"
:
"Konfirmasi password harus diisi!"
,
"alertLabelAddress"
:
"Nama alamat harus diisi!"
,
"alertLabelAddress"
:
"Nama alamat harus diisi!"
,
"alertDetailAddress"
:
"Detail alamat harus diisi!"
,
"alertDetailAddress"
:
"Detail alamat harus diisi!"
,
"alertVoucher"
:
"Voucher tidak bisa digunakan dengan point"
"alertVoucher"
:
"Voucher tidak bisa digunakan dengan point"
,
"alertemailblank"
:
"Email tidak boleh kosong"
}
}
\ No newline at end of file
view/ChangeEmail.js
View file @
00dff2ee
...
@@ -19,55 +19,61 @@ class ChangeEmail extends React.Component {
...
@@ -19,55 +19,61 @@ class ChangeEmail extends React.Component {
}
}
changeEmail
()
{
changeEmail
()
{
this
.
setState
({
if
(
this
.
state
.
email
==
""
)
{
spinner
:
true
,
Alert
.
alert
(
""
,
i18n
.
t
(
'alertemailblank'
));
})
}
else
{
this
.
setState
({
let
paramater
=
{
spinner
:
true
,
"email"
:
this
.
state
.
email
,
})
"registration_id"
:
this
.
props
.
registration_id
}
let
paramater
=
{
"email"
:
this
.
state
.
email
,
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/auth/register_change_email'
,
paramater
).
then
(
res
=>
{
"registration_id"
:
this
.
props
.
registration_id
// console.log(res);
let
loginProps
=
{
email
:
this
.
state
.
email
}
}
let
emailConfirmProps
=
{
isEmailverif
:
false
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/auth/register_change_email'
,
paramater
).
then
(
res
=>
{
}
// console.log(res);
this
.
props
.
setChangeEmail
(
loginProps
)
let
loginProps
=
{
this
.
props
.
setEmailConfirm
(
emailConfirmProps
)
email
:
this
.
state
.
email
Alert
.
alert
(
}
''
,
let
emailConfirmProps
=
{
i18n
.
t
(
'alertCheckEmail'
),
isEmailverif
:
false
[
}
{
this
.
props
.
setChangeEmail
(
loginProps
)
text
:
'OK'
,
onPress
:
()
=>
{
this
.
props
.
setEmailConfirm
(
emailConfirmProps
)
this
.
setState
({
Alert
.
alert
(
''
,
i18n
.
t
(
'alertCheckEmail'
),
[
{
text
:
'OK'
,
onPress
:
()
=>
{
this
.
setState
({
spinner
:
false
,
})
this
.
props
.
navigation
.
navigate
(
"Email Confirmation"
);
}
}
]
);
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
''
,
response
.
msg
,
[
{
text
:
'OK'
,
onPress
:
()
=>
this
.
setState
({
spinner
:
false
,
spinner
:
false
,
})
})
this
.
props
.
navigation
.
navigate
(
"Email Confirmation"
);
}
}
}
]
]
);
);
})
}).
catch
(
error
=>
{
}
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
''
,
response
.
msg
,
[
{
text
:
'OK'
,
onPress
:
()
=>
this
.
setState
({
spinner
:
false
,
})
}
]
);
})
}
}
render
()
{
render
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment