Skip to content

Commit

Permalink
Add articleTypes URL param without UI
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Aug 24, 2022
1 parent 1808d09 commit e013012
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 e013012

Please sign in to comment.