Handle empty input validation in validateCustomer use case
This commit is contained in:
@@ -11,5 +11,9 @@ export async function validateCustomer(input: {
|
||||
zip: string;
|
||||
city: string;
|
||||
}): Promise<Customer[]> {
|
||||
if (Object.values(input).every(value => !value?.trim())) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return await callApi<Customer[]>(customerRoutes.validate, "POST", input);
|
||||
}
|
||||
Reference in New Issue
Block a user