X-Git-Url: http://jaekl.net/gitweb/?p=quanweb.git;a=blobdiff_plain;f=js%2FBooksModel.js;h=75e065194ccdc49602033971208598b9bcde7c64;hp=984519d137409329027f20ca894beeeb18409ab0;hb=e2b95cefd1e34e652317fdf82595932c0bf0c6bb;hpb=32c817b6cf7484487c1160cec8a4b9e770b8404a diff --git a/js/BooksModel.js b/js/BooksModel.js index 984519d..75e0651 100644 --- a/js/BooksModel.js +++ b/js/BooksModel.js @@ -71,13 +71,12 @@ var BooksModel = (function() { } fetch(url, {method:'GET', cache:'default'}) - .then(response => response.json()) - .then((jsonValue) => { - console.log('JSON response for info: ', jsonValue); + .then(function(response) {return response.json();}) + .then(function(jsonValue) { my.cache = jsonValue; notifyAll(); // inform all subscribers that the model has been updated }) - .catch(err => { + .catch(function(err) { var msg = 'Error fetching book details via URL: ' + url + ': ' + err; console.log(msg, err.stack); report(msg);