From e0130121d06d74d2a5bf7c4bcc9667fad9048c93 Mon Sep 17 00:00:00 2001 From: Johnson Liang Date: Wed, 24 Aug 2022 13:25:31 +0800 Subject: [PATCH] Add articleTypes URL param without UI --- pages/articles.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/articles.js b/pages/articles.js index 69c327de..7dd7b5ed 100644 --- a/pages/articles.js +++ b/pages/articles.js @@ -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;