CEC-1965 Cleanup (#163)
This commit is contained in:
@@ -7,27 +7,31 @@ export const validateSupplier = (supplier) => {
|
||||
|
||||
validateEmail(supplier.email);
|
||||
|
||||
if (supplier.contact.length === 0) {
|
||||
if (!supplier?.id) {
|
||||
throw new Error("id required");
|
||||
}
|
||||
|
||||
if (!supplier?.contact) {
|
||||
throw new Error("contact required");
|
||||
}
|
||||
|
||||
if (supplier.company.length === 0) {
|
||||
if (!supplier?.company) {
|
||||
throw new Error("company required");
|
||||
}
|
||||
|
||||
if (supplier.address.length === 0) {
|
||||
if (!supplier?.address) {
|
||||
throw new Error("address required");
|
||||
}
|
||||
|
||||
if (supplier.telephone.length === 0) {
|
||||
if (!supplier?.telephone) {
|
||||
throw new Error("telephone required");
|
||||
}
|
||||
|
||||
if (supplier.program.length === 0) {
|
||||
if (!supplier?.program) {
|
||||
throw new Error("program required");
|
||||
}
|
||||
|
||||
if (supplier.ecus.length === 0) {
|
||||
if (!supplier?.ecus) {
|
||||
throw new Error("ecus required");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user