From a6c1f3f7ce498e32817cc8c74d439e8d99d6fbf4 Mon Sep 17 00:00:00 2001 From: Danshil Kokil Mungur Date: Sat, 28 May 2022 16:48:23 +0400 Subject: [PATCH] fix(api): ignore filter if unset in media route (#2647) Co-authored-by: Ryan Cohen --- server/routes/media.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes/media.ts b/server/routes/media.ts index 429b2010f..0c6e784df 100644 --- a/server/routes/media.ts +++ b/server/routes/media.ts @@ -66,7 +66,7 @@ mediaRoutes.get('/', async (req, res, next) => { try { const [media, mediaCount] = await mediaRepository.findAndCount({ order: sortFilter, - where: { + where: statusFilter && { status: statusFilter, }, take: pageSize,