This commit is contained in:
parent
9388b873c6
commit
dfddde1d5c
|
@ -102,23 +102,16 @@ async function upsert() {
|
|||
formData.append(dms.value.files[i].name, dms.value.files[i]);
|
||||
dms.value.hasFileAttached = true;
|
||||
}
|
||||
const url = !isEdit ? 'Dms/uploadFile' : `dms/${dms.value.id}/updateFile`;
|
||||
const { data } = await axios.post(url, formData, {
|
||||
params: dms.value,
|
||||
});
|
||||
|
||||
if (data.length) invoiceIn.value.dmsFk = data[0].id;
|
||||
|
||||
if (!isEdit) {
|
||||
const { data } = await axios.post('Dms/uploadFile', formData, {
|
||||
params: dms.value,
|
||||
});
|
||||
if (data.length) invoiceIn.value.dmsFk = data[0].id;
|
||||
createDmsRef.value.hide();
|
||||
} else if (isEdit) {
|
||||
const { data } = await axios.post(
|
||||
`dms/${dms.value.id}/updateFile`,
|
||||
formData,
|
||||
{
|
||||
params: dms.value,
|
||||
}
|
||||
);
|
||||
|
||||
if (data.length) invoiceIn.value.dmsFk = data[0].id;
|
||||
editDmsRef.value.hide();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue