updates kontakt_id / adresse_id in profilUpdateRequest after inserting new kontakt/adresse in db

This commit is contained in:
SimonGschnell
2024-01-25 16:43:47 +01:00
parent 20672cd311
commit 15cd9155f1
7 changed files with 68 additions and 30 deletions
@@ -69,7 +69,6 @@ export default {
//? if the topic was passed through the prop add it to the component
this.topic = this.editData.topic;
}
console.log("here",this.editData);
},
@@ -134,7 +134,7 @@ export default {
created() {
this.data = JSON.parse(JSON.stringify(this.list.data));
this.view = JSON.parse(JSON.stringify(this.list.view));
},
mounted() {
@@ -278,7 +278,7 @@ export default {
view:"text_input",
data:{
titel:"postnomen",
value:this.data.titel,
value:this.data.postnomen,
}
},
}
@@ -40,7 +40,6 @@ export default {
}
},
openModal(updateRequest) {
console.log(JSON.stringify(updateRequest));
let view = this.getView(updateRequest.topic,updateRequest.status);
let data = null;
@@ -74,7 +73,6 @@ export default {
content['status_timestamp']=updateRequest.status_timestamp;
}
//? only show the popup if also the right content is available
if(content){
EditProfil.popup({
@@ -1,10 +1,31 @@
export default {
import Adresse from "./Adresse.js";
import Kontakt from "./Kontakt.js";
export default {
components:{
Adresse,
Kontakt,
},
data(){
return {
}
},
computed:{
getComponentView: function(){
let title = this.topic.toLowerCase();
if(title.includes("adressen")) return "Adresse";
else if(title.includes("kontakte"))return "Kontakt";
else return "text_input";
},
cardHeader: function(){
let title = this.topic.toLowerCase();
if(title.includes("delete")) return "Delete";
else if(title.includes("add")) return "Add";
else return "Update";
}
},
props:{
data:{type:Object},
view:{type:String},
@@ -12,11 +33,12 @@ export default {
status_message:{type:String},
status_timestamp:{type:String},
update:{type:Boolean},
topic:{type:String},
},
created(){
},template:`
<div class="form-underline mb-2">
<div class="form-underline-titel">Status</div>
<span class="form-underline-content">{{status}} </span>
@@ -30,6 +52,22 @@ export default {
<div class="form-underline mb-2">
<div class="form-underline-titel">Date</div>
<span class="form-underline-content">{{status_timestamp}} </span>
</div>`,
</div>
<div class="card mt-4">
<div class="card-header">
<i class="fa" :class="{'fa-trash':cardHeader==='Delete', 'fa-edit':cardHeader==='Update', 'fa-plus':cardHeader==='Add'}" ></i>
{{cardHeader}}
</div>
<div class="card-body">
<div v-if="getComponentView === 'text_input'" class="form-underline mb-2">
<div class="form-underline-titel">{{topic}}</div>
<span class="form-underline-content">{{data}} </span>
</div>
<component v-else :is="getComponentView" :data="data"></component>
</div>
</div>
`,
}