Skip to content

Commit

Permalink
Using querystring
Browse files Browse the repository at this point in the history
  • Loading branch information
dijs committed May 22, 2016
1 parent f103f30 commit 87cd755
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'babel-polyfill';
import fetch from 'isomorphic-fetch';
import _ from 'underscore';
import markupParser from './wiki-markup-parser';
import querystring from 'querystring';

/**
* @namespace
Expand Down Expand Up @@ -35,9 +36,7 @@ class Wiki {
format: 'json',
action: 'query'
});
const queryString = Object.keys(qs)
.map(key => `${key}=${qs[key]}`).join('&');
const url = `${this.options.apiUrl}?${queryString}`;
const url = `${this.options.apiUrl}?${querystring.stringify(qs)}`;
return fetch(url, fetchOptions).then(res => res.json());
}
pagination(params, parseResults) {
Expand Down

0 comments on commit 87cd755

Please sign in to comment.