Skip to content

Commit

Permalink
Strick check undefined !== filter for attributes within `QGISProvid…
Browse files Browse the repository at this point in the history
…er::getFeatures()` (editing plugin) (#482)
  • Loading branch information
Raruto authored Sep 4, 2023
1 parent d61feec commit c026bfa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/core/layers/providersfactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const Filter = require('core/layers/filter/filter');
const GETFEATUREINFO_IMAGE_SIZE = [101, 101];
const DPI = geoutils.getDPI();

const is_defined = d => undefined !== d;


/**
* ORIGINAL SOURCE: src/app/core/layers/providers/[email protected]
*/
Expand Down Expand Up @@ -390,7 +393,7 @@ const Providers = {
url,
contentType: 'application/json',
});
} else if (filter.bbox) { // bbox filter
} else if (is_defined(filter.bbox)) { // bbox filter
promise = XHR.post({
url,
data: JSON.stringify({
Expand All @@ -399,20 +402,20 @@ const Providers = {
}),
contentType: 'application/json',
})
} else if (filter.fid) { // fid filter
} else if (is_defined(filter.fid)) { // fid filter
promise = RelationsService.getRelations(filter.fid);
} else if (filter.field) {
promise = XHR.post({
url,
data: JSON.stringify(filter),
contentType: 'application/json',
})
} else if (filter.fids) {
} else if (is_defined(filter.fids)) {
promise = XHR.get({
url,
params: filter
})
} else if (filter.nofeatures) {
} else if (is_defined(filter.nofeatures)) {
promise = XHR.post({
url,
data: JSON.stringify({
Expand Down

0 comments on commit c026bfa

Please sign in to comment.