diff --git a/appinfo/info.xml b/appinfo/info.xml
index 823b375..6ce431f 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenCatalogi/.github/issues/new/choose)
Create a [feature request](https://github.com/OpenCatalogi/.github/issues/new/choose)
]]>
- 0.1.1
+ 0.1.2
agpl
Conduction
ZaakAfhandelApp
diff --git a/src/views/klanten/KlantDetails.vue b/src/views/klanten/KlantDetails.vue
index 4c8462c..30bc654 100644
--- a/src/views/klanten/KlantDetails.vue
+++ b/src/views/klanten/KlantDetails.vue
@@ -290,6 +290,7 @@ export default {
},
data() {
return {
+ currentActiveKlant: undefined, // whole klant object
zaken: [],
taken: [],
berichten: [],
@@ -298,7 +299,16 @@ export default {
}
},
mounted() {
- this.fetchKlantData(klantStore.klantItem.id);
+ if (klantStore.klantItem?.id) {
+ this.currentActiveKlant = klantStore.klantItem
+ this.fetchKlantData(klantStore.klantItem.id)
+ }
+ },
+ updated() {
+ if (klantStore.klantItem?.id && JSON.stringify(this.currentActiveKlant) !== JSON.stringify(klantStore.klantItem)) {
+ this.currentActiveKlant = klantStore.klantItem
+ this.fetchKlantData(klantStore.klantItem.id)
+ }
},
methods: {
fetchKlantData(id) {
@@ -306,37 +316,33 @@ export default {
.then(response => response.json())
.then(data => {
if (Array.isArray(data.results)) {
- this.zaken = data.results;
+ this.zaken = data.results
}
- console.log(this.zaken);
- return fetch(`/index.php/apps/zaakafhandelapp/api/klanten/${id}/taken`);
+ return fetch(`/index.php/apps/zaakafhandelapp/api/klanten/${id}/taken`)
})
.then(response => response.json())
.then(data => {
if (Array.isArray(data.results)) {
- this.taken = data.results;
+ this.taken = data.results
}
- console.log(this.taken);
- return fetch(`/index.php/apps/zaakafhandelapp/api/klanten/${id}/berichten`);
+ return fetch(`/index.php/apps/zaakafhandelapp/api/klanten/${id}/berichten`)
})
.then(response => response.json())
.then(data => {
if (Array.isArray(data.results)) {
- this.berichten = data.results;
+ this.berichten = data.results
}
- console.log(this.berichten);
- return fetch(`/index.php/apps/zaakafhandelapp/api/klanten/${id}/audit_trail`);
+ return fetch(`/index.php/apps/zaakafhandelapp/api/klanten/${id}/audit_trail`)
})
.then(response => response.json())
.then(data => {
if (Array.isArray(data)) {
- this.auditTrails = data;
+ this.auditTrails = data
}
- console.log(this.auditTrails);
})
.catch(error => {
- console.error('Error fetching klant data:', error);
- });
+ console.error('Error fetching klant data:', error)
+ })
},
},
}