Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed additional '?' in WFS request #2048

Merged
merged 5 commits into from
Aug 1, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions web/client/epics/wfsquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

const Rx = require('rxjs');
const axios = require('../libs/ajax');
const Url = require('url');
const {changeSpatialAttribute, SELECT_VIEWPORT_SPATIAL_METHOD, updateGeometrySpatialField} = require('../actions/queryform');
const {CHANGE_MAP_VIEW} = require('../actions/map');
const {FEATURE_TYPE_SELECTED, QUERY, featureTypeLoaded, featureTypeError, querySearchResponse, queryError, featureClose} = require('../actions/wfsquery');
Expand Down Expand Up @@ -122,8 +123,10 @@ const getWFSFilterData = (filterObj) => {

const getWFSFeature = (searchUrl, filterObj) => {
const data = getWFSFilterData(filterObj);
const urlParsedObj = Url.parse(searchUrl);
const parsedUrl = urlParsedObj.protocol + '//' + urlParsedObj.host + urlParsedObj.pathname;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should mix the query string parameters (service, outputFormat) with the ones coming from the original URL. So you can keep additional parameters in the URL.

return Rx.Observable.defer( () =>
axios.post(searchUrl + '?service=WFS&outputFormat=json', data, {
axios.post(parsedUrl + '?service=WFS&outputFormat=json', data, {
timeout: 60000,
headers: {'Accept': 'application/json', 'Content-Type': 'application/json'}
}));
Expand Down Expand Up @@ -197,7 +200,6 @@ const featureTypeSelectedEpic = action$ =>
const wfsQueryEpic = (action$, store) =>
action$.ofType(QUERY)
.switchMap(action => {

return Rx.Observable.merge(
Rx.Observable.of(setControlProperty('drawer', 'enabled', false)),
getWFSFeature(action.searchUrl, action.filterObj)
Expand Down