Skip to content

Commit

Permalink
Merge pull request #55 from comicrelief/GP-774_school_lookup
Browse files Browse the repository at this point in the history
fix: Use Request instead of buildRequest to pass validation in libs using storybook
  • Loading branch information
NoelLH authored Oct 12, 2017
2 parents db56e39 + 59773ff commit 9482595
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/utils/drupal-api-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { connect } from 'react-refetch';
const cache = new Map();

export default connect.defaults({
buildRequest(mapping) {
const options = {
method: mapping.method,
Request: (input, options) => {
const optionsWithCachingEnabled = {
...options,
cache: 'force-cache',
redirect: mapping.redirect,
body: mapping.body,
};
return new Request(mapping.url, options);
return new Request(input, optionsWithCachingEnabled);
},

fetch(input, init) {
Expand Down

0 comments on commit 9482595

Please sign in to comment.