Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
Release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenedith committed Sep 20, 2015
1 parent 44cbeeb commit 85c20d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/event/EventsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,13 @@ var EventsAdapter = function EventsAdapter() {
//console.log('get events from ' + url);

fetch(url)
.then((response) => response.json())
.then((response) => {
if (response.headers.get('content-type') === 'application/json') {
return response.json();
}

throw new TypeError();
})
.catch((error) => {
console.error(error);
return callback(error, []);
Expand Down
8 changes: 7 additions & 1 deletion lib/festival/FestivalsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ var FestivalsAdapter = function FestivalsAdapter() {

var fetchFestivals = function fetchFestivals(callback) {
fetch(API_URL + FESTIVALS_RESOURCE_NAME + FESTIVALS_QUERY)
.then((response) => response.json())
.then((response) => {
if (response.headers.get('content-type') === 'application/json') {
return response.json();
}

throw new TypeError();
})
.catch((error) => {
console.error(error);
return callback(error, []);
Expand Down

0 comments on commit 85c20d8

Please sign in to comment.