# HG changeset patch # User Markus Kottlaender # Date 1558365287 -7200 # Node ID 8c96b7379aea242ae5079ac9f96a916be7477360 # Parent d5dbfba9faaed82cc51dc4f1ce954b4f9bb104f7 client: fairway availability: made store action work with both types of feature objects diff -r d5dbfba9faae -r 8c96b7379aea client/src/store/fairwayavailability.js --- a/client/src/store/fairwayavailability.js Mon May 20 16:54:52 2019 +0200 +++ b/client/src/store/fairwayavailability.js Mon May 20 17:14:47 2019 +0200 @@ -110,10 +110,14 @@ loadAvailableFairwayDepth: ({ commit }, options) => { return new Promise((resolve, reject) => { const { feature, from, to, frequency, LOS } = options; + let name = + feature.constructor.name === "Feature" + ? feature.get("objnam") + : feature.properties.name; const start = encodeURIComponent("00:00:00+00:00"); const end = encodeURIComponent("23:59:59+00:00"); const URL = `/data/bottleneck/fairway-depth/${encodeURIComponent( - feature.properties.name + name )}?from=${from}T${start}&to=${to}T${end}&mode=${frequency}&los=${LOS}`; HTTP.get(URL, { headers: { "X-Gemma-Auth": localStorage.getItem("token") }