Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into feature/dashbo…
Browse files Browse the repository at this point in the history
…ard-widgets
  • Loading branch information
remko48 committed Oct 23, 2024
2 parents 9c068e5 + 3ca927f commit 3e88add
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
]]></description>
<version>0.1.1</version>
<version>0.1.2</version>
<licence>agpl</licence>
<author mail="[email protected]" homepage="https://www.conduction.nl/">Conduction</author>
<namespace>ZaakAfhandelApp</namespace>
Expand Down
34 changes: 20 additions & 14 deletions src/views/klanten/KlantDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export default {
},
data() {
return {
currentActiveKlant: undefined, // whole klant object
zaken: [],
taken: [],
berichten: [],
Expand All @@ -298,45 +299,50 @@ 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) {
fetch(`/index.php/apps/zaakafhandelapp/api/klanten/${id}/zaken`)
.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)
})
},
},
}
Expand Down

0 comments on commit 3e88add

Please sign in to comment.