change back
This commit is contained in:
@@ -38,17 +38,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => {
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("description", values.description);
|
||||
// if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
const attachments = [
|
||||
{ title: 'فرم الف', file: values.confirm_img },
|
||||
];
|
||||
|
||||
attachments.forEach((attachment, index) => {
|
||||
formData.append(`attachment[${index}][title]`, attachment.title);
|
||||
formData.append(`attachment[${index}][file]`, attachment.file);
|
||||
});
|
||||
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_PASSENGER_OFFICE}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
|
||||
Reference in New Issue
Block a user