From 8eb4982d4e67d2b9a65186b6a39564d4c92e3bfb Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Mon, 13 Jan 2025 11:41:45 +0100 Subject: [PATCH] fix(filter): check against null --- source/components/datatable/datasource/rest.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/components/datatable/datasource/rest.mjs b/source/components/datatable/datasource/rest.mjs index 39b90061f..9379aceb9 100644 --- a/source/components/datatable/datasource/rest.mjs +++ b/source/components/datatable/datasource/rest.mjs @@ -343,7 +343,7 @@ class Rest extends Datasource { } /** - * Fetches the data from the rest api. + * Writes the data to the rest api. * @return {Promise} */ write() { @@ -426,12 +426,12 @@ function initFilter() { this[filterObserverSymbol] = new Observer(() => { const query = filterControl.getOption("query"); - if (query === undefined) { + if (query === undefined || query === null) { return; } this.setParameters({ query: query }); - this.fetch() + this.read() .then((response) => { if (!(response instanceof Response)) { return Promise.reject(new Error("response is not a Response object")); @@ -536,7 +536,7 @@ function initAutoInit() { } queueMicrotask(() => { - this.fetch().catch(() => {}); + this.read().catch(() => {}); }); } @@ -548,7 +548,7 @@ function initEventHandler() { entries.forEach((entry) => { if (entry.isIntersecting) { if (entry.intersectionRatio > 0) { - this.fetch(); + this.read(); } // only load once -- GitLab