fix(api): ignore filter if unset in media route (#2647)
Co-authored-by: Ryan Cohen <ryan@sct.dev>
This commit is contained in:
committed by
GitHub
parent
eb5248d8d1
commit
a6c1f3f7ce
@@ -66,7 +66,7 @@ mediaRoutes.get('/', async (req, res, next) => {
|
|||||||
try {
|
try {
|
||||||
const [media, mediaCount] = await mediaRepository.findAndCount({
|
const [media, mediaCount] = await mediaRepository.findAndCount({
|
||||||
order: sortFilter,
|
order: sortFilter,
|
||||||
where: {
|
where: statusFilter && {
|
||||||
status: statusFilter,
|
status: statusFilter,
|
||||||
},
|
},
|
||||||
take: pageSize,
|
take: pageSize,
|
||||||
|
|||||||
Reference in New Issue
Block a user