mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 00:24:35 +00:00
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:
@@ -45,14 +45,13 @@ export default {
|
||||
//TODO post request
|
||||
//? new requests
|
||||
insertFile: function (dms, replace = null) {
|
||||
const url =
|
||||
|
||||
return this.$fhcApi.post(
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
`/Cis/ProfilUpdate/insertFile/${replace}`;
|
||||
|
||||
return axios.post(url, dms, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
`/api/frontend/v1/ProfilUpdate/insertFile/${replace}`,
|
||||
dms);
|
||||
|
||||
},
|
||||
|
||||
getProfilRequestFiles: function (requestID) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user