Skip to content

Commit

Permalink
Merge pull request #501 from cofacts/article-type
Browse files Browse the repository at this point in the history
Add articleTypes URL param without UI
  • Loading branch information
MrOrz authored Aug 24, 2022
2 parents 1808d09 + e013012 commit 32f1d6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pages/articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ function urlQuery2Filter({ userId, ...query } = {}) {
const selectedReplyTypes = ReplyTypeFilter.getValues(query);
if (selectedReplyTypes.length) filterObj.replyTypes = selectedReplyTypes;

// No UI for article types yet, so we read from `query` directly
const articleTypes = query.articleTypes ? query.articleTypes.split(',') : [];
if (articleTypes.length) filterObj.articleTypes = articleTypes;

// Return filterObj only when it is populated.
if (!Object.keys(filterObj).length) {
return undefined;
Expand Down

0 comments on commit 32f1d6c

Please sign in to comment.