Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Commit

Permalink
Updated startup server event name. Removed limit on number of posts f…
Browse files Browse the repository at this point in the history
…etched (#1)

* api: server:start event is now server.start
* fix: now fetching all posts (instead of the default value, 15 - https://api.ghost.org/docs/posts)
  • Loading branch information
DarkSmile92 authored and mlbrgl committed Apr 27, 2018
1 parent f131527 commit d78045a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const GhostAlgolia = {
function bulkIndex(events, config, urlUtils){

// Emitted in ghost-server.js
events.on('server:start', function(){
events.on('server.start', function(){
client.findOne({slug: 'ghost-frontend'}, {context: {internal: true}})
.then((client) => getContent(urlUtils.urlFor('api', true) + 'posts/?formats=mobiledoc&client_id=ghost-frontend&client_secret=' + client.attributes.secret))
.then((client) => getContent(urlUtils.urlFor('api', true) + 'posts/?formats=mobiledoc&limit=all&client_id=ghost-frontend&client_secret=' + client.attributes.secret))
.then((data) => {
let posts = JSON.parse(data).posts;
if(posts.length > 0) {
Expand Down

0 comments on commit d78045a

Please # to comment.