Skip to content

Commit

Permalink
Merge pull request #436 from cofacts/landing-with-replies
Browse files Browse the repository at this point in the history
[LandingPage] include messages that has been replied
  • Loading branch information
MrOrz committed May 15, 2021
2 parents 3ae6359 + 6feae73 commit 024f329
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions components/LandingPage/SectionArticles.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import leftImage from './images/article-left.png';
import rightImage from './images/article-right.png';

const LIST_ARTICLES = gql`
query GetArticlesList(
$filter: ListArticleFilter
$orderBy: [ListArticleOrderBy]
$after: String
) {
ListArticles(filter: $filter, orderBy: $orderBy, after: $after, first: 10) {
query GetArticlesInLandingPage {
ListArticles(
filter: { replyRequestCount: { GTE: 3 } }
orderBy: [{ createdAt: DESC }]
first: 10
) {
edges {
node {
id
Expand Down Expand Up @@ -131,20 +131,11 @@ const SectionArticles = () => {
const classes = useStyles();
const router = useRouter();

const listQueryVars = {
filter: {
replyRequestCount: { GTE: 2 },
hasArticleReplyWithMorePositiveFeedback: false,
},
orderBy: [{ lastRequestedAt: 'DESC' }],
};

const {
loading,
data: listArticlesData,
error: listArticlesError,
} = useQuery(LIST_ARTICLES, {
variables: listQueryVars,
ssr: false, // Fetch on browser is OK
});

Expand Down

0 comments on commit 024f329

Please sign in to comment.