Skip to content

Commit

Permalink
Merge pull request #965 from simon-leech/custom-view-tables
Browse files Browse the repository at this point in the history
Ensure tables response is always a string
  • Loading branch information
dbauszus-glx authored Oct 16, 2023
2 parents f0bdac3 + d7c35f5 commit 74e0188
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/location/get.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export default async function (location, list = location.layer.mapview.locations
return;
}


// Get dbs table from layer.
location.table = location.table
|| location.layer.table
|| Object.values(location.layer.tables).find(table => !!table)
location.table ??= location.layer.table ||
Object.values(location.layer.tables).find(table => typeof table === 'string')

// Get data from location api.
const response = await mapp.utils.xhr(
Expand Down Expand Up @@ -74,10 +74,10 @@ export default async function (location, list = location.layer.mapview.locations
location.layer.mapview.interaction?.locations?.delete(location.hook)

// A location must have a record from a listview.
location.record
location.record

// Hooks must be enabled on the mapview.
&& location.layer.mapview.hooks
&& location.layer.mapview.hooks

// Push location hook to URL params.
&& mapp.hooks.push('locations', location.hook)
Expand Down

0 comments on commit 74e0188

Please sign in to comment.