Skip to content

Commit

Permalink
Merge pull request #8 from storyblok/fix/totapages
Browse files Browse the repository at this point in the history
fix: total pages fallback to lowercase
  • Loading branch information
christianzoppi authored Jul 20, 2022
2 parents 9a1f6c1 + 575bfec commit 0ef2523
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class Wp {
const req = await axios.get(query_endpoint)
this.content_types[content_name] = this.content_types[content_name].concat(req.data)
if (page_i === 1) {
page_max_i = req.headers['X-WP-TotalPages']
page_max_i = req.headers['X-WP-TotalPages'] || req.headers['x-wp-totalpages']
}
} catch (err) {
console.log(`Error while fetching entries from WordPress: ${err.message}`)
Expand Down Expand Up @@ -90,4 +90,4 @@ export default class Wp {
}
return field_value
}
}
}

0 comments on commit 0ef2523

Please sign in to comment.