adds insertFile to the new ProfilUpdate FhcAPIController and starts a transaction when deleting the foreign key from the profil update and deleting the old file

This commit is contained in:
SimonGschnell
2024-07-22 11:24:47 +02:00
parent 0cc6222175
commit a0871657ca
5 changed files with 139 additions and 10 deletions
@@ -116,14 +116,14 @@ export default {
const result = this.editData.updateID
? //? updating old attachment by replacing
//* second parameter of api request insertFile checks if the file has to be replaced or not
await Vue.$fhcapi.ProfilUpdate.insertFile(
await this.$fhcApi.factory.profilUpdate.insertFile(
formData,
this.editData.updateID
).then((res) => {
return res.data?.map((file) => file.dms_id);
})
: //? fresh insert of new attachment
await Vue.$fhcapi.ProfilUpdate.insertFile(formData).then((res) => {
await this.$fhcApi.factory.profilUpdate.insertFile(formData).then((res) => {
return res.data?.map((file) => file.dms_id);
});
return result;
@@ -129,14 +129,14 @@ export default {
const result = this.editData.updateID
? //? updating old attachment by replacing
//* second parameter of api request insertFile checks if the file has to be replaced or not
await Vue.$fhcapi.ProfilUpdate.insertFile(
await this.$fhcApi.factory.profilUpdate.insertFile(
formData,
this.editData.updateID
).then((res) => {
return res.data?.map((file) => file.dms_id);
})
: //? fresh insert of new attachment
await Vue.$fhcapi.ProfilUpdate.insertFile(formData).then((res) => {
await this.$fhcApi.factory.profilUpdate.insertFile(formData).then((res) => {
return res.data?.map((file) => file.dms_id);
});
return result;