Skip to content

Commit

Permalink
Add state: live to project queries on home (#5376)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbouslog authored and srallen committed Jun 19, 2019
1 parent ed7cfb9 commit 940a84f
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions app/lib/get-social-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ import talkClient from 'panoptes-client/lib/talk-client';
import Publications from './publications';

function getNewestProject() {
return apiClient.type('projects').get({ cards: true, page_size: 1, sort: '-launch_date', launch_approved: true })
.then(([newestProject]) => {
return newestProject;
});
return apiClient.type('projects').get({
cards: true,
launch_approved: true,
page_size: 1,
sort: '-launch_date',
state: 'live'
})
.then(([newestProject]) => {
return newestProject;
});
}

function getBlogPosts(returnPosts) {
Expand All @@ -20,9 +26,15 @@ function getBlogPosts(returnPosts) {
}

function getRecentProjects() {
const query = { launch_approved: true, page_size: 3, sort: '-updated_at', cards: true };
const query = {
cards: true,
launch_approved: true,
page_size: 3,
sort: '-updated_at',
state: 'live'
};
return apiClient.type('projects').get(query)
.then(recentProjects => recentProjects);
.then(recentProjects => recentProjects);
}

function getPublication() {
Expand Down

0 comments on commit 940a84f

Please sign in to comment.