refactor fhcApi

This commit is contained in:
cgfhtw
2025-03-24 13:38:49 +01:00
parent f6352211f2
commit 9f06fbcf93
142 changed files with 4713 additions and 785 deletions
@@ -3,6 +3,8 @@ import Alert from "../../Bootstrap/Alert.js";
import Kontakt from "../Profil/ProfilComponents/Kontakt.js";
import Adresse from "../Profil/ProfilComponents/Adresse.js";
import ApiProfilUpdate from '../../../api/factory/profilUpdate.js';
export default {
components: {
BsModal,
@@ -62,11 +64,12 @@ export default {
handleRequest: function (type) {
this.loading = true;
this.setLoading(true);
this.$fhcApi.factory.profilUpdate[
type.toLowerCase() == "accept"
? "acceptProfilRequest"
: "denyProfilRequest"
](this.data)
this.$api
.call(ApiProfilUpdate[
type.toLowerCase() == "accept"
? "acceptProfilRequest"
: "denyProfilRequest"
](this.data))
.then((res) => {
this.result = true;
})
@@ -93,11 +96,13 @@ export default {
created() {
// only fetching the profilUpdate Attachemnts if the profilUpdate actually has attachments
if (this.value.attachment_id) {
this.$fhcApi.factory.profilUpdate.getProfilRequestFiles(
this.data.profil_update_id
).then((res) => {
this.files = res.data;
});
this.$api
.call(ApiProfilUpdate.getProfilRequestFiles(
this.data.profil_update_id
))
.then((res) => {
this.files = res.data;
});
}
},
mounted() {
@@ -3,6 +3,8 @@ import AcceptDenyUpdate from "./AcceptDenyUpdate.js";
import Alert from "../../../components/Bootstrap/Alert.js";
import Loading from "../../../components/Loader.js";
import ApiProfilUpdate from '../../../api/factory/profilUpdate.js';
const sortProfilUpdates = (ele1, ele2, thisPointer) => {
let result = 0;
if (ele1.status === thisPointer.profilUpdateStates["Pending"]) {
@@ -127,7 +129,8 @@ export default {
"acceptUpdate"
)}`,
action: (e, column) => {
this.$fhcApi.factory.profilUpdate.acceptProfilRequest(column.getData())
this.$api
.call(ApiProfilUpdate.acceptProfilRequest(column.getData()))
.then((res) => {
this.$refs.UpdatesTable.tabulator.setData();
})
@@ -143,7 +146,8 @@ export default {
"denyUpdate"
)}`,
action: (e, column) => {
this.$fhcApi.factory.profilUpdate.denyProfilRequest(column.getData())
this.$api
.call(ApiProfilUpdate.denyProfilRequest(column.getData()))
.then((res) => {
this.$refs.UpdatesTable.tabulator.setData();
})
@@ -296,7 +300,8 @@ export default {
},
methods: {
denyProfilUpdate: function (data) {
this.$fhcApi.factory.profilUpdate.denyProfilRequest(data)
this.$api
.call(ApiProfilUpdate.denyProfilRequest(data))
.then((res) => {
// block when the request was successful
})
@@ -306,7 +311,8 @@ export default {
});
},
acceptProfilUpdate: function (data) {
this.$fhcApi.factory.profilUpdate.acceptProfilRequest(data)
this.$api
.call(ApiProfilUpdate.acceptProfilRequest(data))
.then((res) => {
// block when the request was successful
})