Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
408ab7ea
Commit
408ab7ea
authored
Dec 09, 2019
by
Yusuf Sholeh
Browse files
refactor: remove duplicate lines
parent
00c4403a
Pipeline
#26981
passed with stages
in 6 minutes and 40 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
assets/js/ProfileHandler.jsx
View file @
408ab7ea
...
...
@@ -12,6 +12,11 @@ export default class ProfileHandler extends React.Component {
'
Pastikan link github yang anda tulis benar.(Berpola : https://github.com/<username>
'
,
);
}
else
{
this
.
submitForm
();
}
};
submitForm
=
()
=>
{
const
submitForm
=
{};
Object
.
keys
(
this
.
state
.
form
).
forEach
((
key
)
=>
{
if
(
this
.
state
.
form
[
key
]
!==
''
)
{
...
...
@@ -37,8 +42,7 @@ export default class ProfileHandler extends React.Component {
this
.
modalAlert
.
open
(
'
Pembaharuan profil gagal
'
,
Dumper
.
dump
(
r
));
}),
);
}
};
}
handleFile
=
(
e
)
=>
{
const
{
form
}
=
this
.
state
;
...
...
assets/js/ProfilePage.jsx
View file @
408ab7ea
...
...
@@ -253,31 +253,7 @@ export default class ProfilePage extends ProfileHandler {
return
;
}
{
const
submitForm
=
{};
Object
.
keys
(
this
.
state
.
form
).
forEach
((
key
)
=>
{
if
(
this
.
state
.
form
[
key
]
!==
''
)
{
submitForm
[
key
]
=
this
.
state
.
form
[
key
];
}
});
this
.
setState
({
loading
:
true
});
Server
.
submit
(
`/students/
${
this
.
state
.
id
}
/profile/`
,
submitForm
,
'
PATCH
'
,
).
then
(
()
=>
{
this
.
setState
({
loading
:
false
});
this
.
modalAlert
.
open
(
'
Profil berhasil diperbaharui
'
,
'
Silakan periksa kembali profil anda
'
,
this
.
getProfile
,
);
},
(
error
)
=>
error
.
then
((
r
)
=>
{
this
.
setState
({
loading
:
false
});
this
.
modalAlert
.
open
(
'
Pembaharuan profil gagal
'
,
Dumper
.
dump
(
r
));
}),
);
this
.
submitForm
();
}
};
...
...
package-lock.json
View file @
408ab7ea
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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