Commit bbb19b94 authored by Bilal's avatar Bilal

Added validation for 1 line item

parent 10fbd487
......@@ -80,6 +80,12 @@ const TelepayForm = () => {
};
const handleDeleteLineItem = (index) => {
if (formData.line_items.length <= 1) {
setError('1 line item is needed');
setErrorSnackbarOpen(true);
return;
}
const updatedLineItems = [...formData.line_items];
updatedLineItems.splice(index, 1);
setFormData({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment