From 940a84f20f8f64f13a0ba659c1f29d8cb39405fd Mon Sep 17 00:00:00 2001 From: Mark Bouslog Date: Wed, 19 Jun 2019 12:50:05 -0500 Subject: [PATCH] Add state: live to project queries on home (#5376) --- app/lib/get-social-data.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/app/lib/get-social-data.js b/app/lib/get-social-data.js index 13583c674b..754cd774f9 100644 --- a/app/lib/get-social-data.js +++ b/app/lib/get-social-data.js @@ -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) { @@ -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() {