Skip to content

Commit

Permalink
Fixed latest posts
Browse files Browse the repository at this point in the history
  • Loading branch information
makidoll committed Mar 8, 2019
1 parent 5828c5a commit fe3875e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var roadmap = (()=>{

function checkForNewPosts(dontEmit) {
recentBoards.forEach(board=>{
roadmap.getPosts(board.urlName).then(posts=>{
roadmap.getLatestPosts(board.urlName).then(posts=>{
if (posts[board._id] == undefined) return;
posts = posts[board._id];
//console.log(posts);
Expand Down
6 changes: 3 additions & 3 deletions canny.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ module.exports = function(url) {
});
});

this.getPosts = (boardUrl)=>new Promise((resolve,reject)=>{
getData(url+"/"+boardUrl).then(data=>{
return resolve(data.posts)
this.getLatestPosts = (boardUrl)=>new Promise((resolve,reject)=>{
getData(url+"/"+boardUrl+"?sort=new").then(data=>{
return resolve(data.posts);
}).catch(err=>{
return reject(err);
})
Expand Down

0 comments on commit fe3875e

Please sign in to comment.