Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL KI Ganjil 2021 2022
Clicks - Ecosystem Business
clicks-frontend
Commits
c984e352
Commit
c984e352
authored
Nov 21, 2021
by
Bagus Prabowo
Browse files
chore: added error handling and constraints
parent
3073c42b
Pipeline
#88299
passed with stage
in 10 minutes and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/screens/CreateEcosystemScreen.tsx
View file @
c984e352
...
...
@@ -152,20 +152,57 @@ const CreateEcosystemScreen = ({
}
};
const
handleSubmit
=
async
()
=>
{
if
(
ecosystemSupport
[
1
]
==
null
||
ecosystemCustomer
[
1
]
==
null
||
ecosystemSupplier
[
1
]
==
null
||
ecosystemMainBusiness
[
1
]
==
null
)
{
Alert
.
alert
(
"
Anggota Ekosistem Kategori Kosong
"
,
const
errorHandling
=
()
=>
{
if
(
ecosystemName
==
null
)
{
return
Alert
.
alert
(
"
Nama Ekosistem Kosong
"
,
"
Silahkan isi nama ekosistem
"
);
}
else
if
(
ecosystemName
.
length
<
5
)
{
return
Alert
.
alert
(
"
Nama Ekosistem Terlalu Pendek
"
,
"
Nama ekosistem minimal 5 karakter
"
);
}
else
if
(
ecosystemDetails
==
null
)
{
return
Alert
.
alert
(
"
Detail Ekosistem Kosong
"
,
"
Silahkan isi nama detail ekosistem
"
);
}
else
if
(
ecosystemDetails
.
length
<
10
)
{
return
Alert
.
alert
(
"
Nama Ekosistem Terlalu Pendek
"
,
"
Detail ekosistem minimal 10 karakter
"
);
}
else
if
(
ecosystemCategory
==
null
)
{
return
Alert
.
alert
(
"
Kategori Ekosistem Kosong
"
,
"
Silahkan isi kategori ekosistem
"
);
}
else
if
(
ecosystemSupplier
[
1
]
==
null
)
{
return
Alert
.
alert
(
"
Anggota Supplier Ekosistem Kosong
"
,
"
Silahkan isi ekosistem kategori
"
);
}
else
if
(
ecosystemCustomer
[
1
]
==
null
)
{
return
Alert
.
alert
(
"
Anggota Customer Ekosistem Kosong
"
,
"
Silahkan isi ekosistem kategori
"
);
}
else
if
(
ecosystemSupport
[
1
]
==
null
)
{
return
Alert
.
alert
(
"
Anggota Support Ekosistem Kosong
"
,
"
Silahkan isi ekosistem kategori
"
);
}
else
if
(
ecosystemMainBusiness
[
1
]
==
null
)
{
return
Alert
.
alert
(
"
Anggota Main Business Ekosistem Kosong
"
,
"
Silahkan isi ekosistem kategori
"
);
return
;
}
};
const
handleSubmit
=
async
()
=>
{
errorHandling
();
setIsSubmitting
(
true
);
const
ecosystemCategoryMembers
:
{
categoryMember
:
IEcosystemCategoryMember
;
...
...
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