makes the send button in the profil update popup disabled instead of not showing it

This commit is contained in:
SimonGschnell
2024-02-08 13:47:03 +01:00
parent 89bc5a5d9d
commit cda13ac705
6 changed files with 42 additions and 32 deletions
+2 -3
View File
@@ -38,11 +38,10 @@ const app = Vue.createApp({
ajaxURLGenerator: (url, config, params) => {
//? this function needs to be an array function in order to access the this properties of the Vue component
console.log("showAll printed here:", this.showAll);
if (this.showAll) {
return url + "getProfilUpdates";
return url + "getProfilUpdateWithPermission";
} else {
return url + "getProfilUpdates/pending";
return url + "getProfilUpdateWithPermission/pending";
}
},
ajaxResponse: function (url, params, response) {
@@ -43,6 +43,7 @@ export default {
methods: {
async submitProfilChange() {
//? check if data is valid before making a request
if (this.topic && this.profilUpdate) {
if (this.profilUpdate.files) {
const fileIDs = await this.uploadFiles(this.profilUpdate.files);
@@ -179,7 +180,7 @@ export default {
<template v-slot:footer>
<button class="btn btn-outline-danger " @click="hide">Abbrechen</button>
<button v-if="profilUpdate" @click="submitProfilChange" role="button" class="btn btn-primary">Senden</button>
<button :disabled="!profilUpdate" @click="submitProfilChange" role="button" class="btn btn-primary">Senden</button>
</template>
<!-- end of optional footer -->
</bs-modal>`,
@@ -158,6 +158,9 @@ export default {
},
created(){
//? sorts the profil Updates: pending -> accepted -> rejected
this.data.profilUpdates?.sort(this.sortProfilUpdates);
},
mounted() {