handle condition when endpoint has not been set

This commit is contained in:
Harald Bamberger
2025-04-15 15:38:27 +02:00
parent 26d7d17169
commit b67b19bd1a
@@ -108,8 +108,16 @@ export default {
}
},
ajaxRequestFunc: (url, params) => this.$api.call({url, params}),
ajaxResponse: (url, params, response) => response.data,
ajaxRequestFunc: (url, params) => {
if( url === '' )
{
return Promise.resolve({ data: []});
}
return this.$api.call({url, params});
},
ajaxResponse: (url, params, response) => {
return response?.data;
},
layout: 'fitDataStretch',
layoutColumnsOnNewData: false,
@@ -180,6 +188,15 @@ export default {
updateUrl(endpoint, first) {
this.lastSelected = first ? undefined : this.selected;
if( endpoint === undefined )
{
endpoint = { url: '' };
}
else if( endpoint.url === undefined )
{
endpoint.url = '';
}
const params = {}, filter = {};
if (this.filterKontoCount0)
filter.konto_count_0 = this.filterKontoCount0;