Last active
August 29, 2015 14:06
-
-
Save erwan/f3f7d4b970e964131271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prismic.Api('https://lesbonneschoses.prismic.io/api', function (err, Api) { | |
Api.form('everything') | |
.ref(Api.master()) | |
.query(Prismic.Predicates.at("document.type", "product")).submit(function (err, response) { | |
if (err) { | |
console.log(err); | |
done(); | |
} | |
// The documents object contains a Response object with all documents of type "product". | |
var page = response.page; // The current page number, the first one being 1 | |
var results = response.results; // An array containing the results of the current page; | |
// you may need to retrieve more pages to get all results | |
var prev_page = response.prev_page; // the URL of the previous page (may be null) | |
var next_page = response.next_page; // the URL of the next page (may be null) | |
var results_per_page = response.results_per_page; // max number of results per page | |
var results_size = response.results_size; // the size of the current page | |
var total_pages = response.total_pages; // the number of pages | |
var total_results_size = response.total_results_size; // the total size of results across all pages | |
}); | |
}); |
This is correct, thank you for the heads up.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're missing the closing brace on the inner if statement.