mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-19 03:01:21 +10:00
fix: news frontend
This commit is contained in:
@ -45,23 +45,27 @@ class NewsManager {
|
||||
return await prisma.article.findMany({
|
||||
where: {
|
||||
AND: [
|
||||
{
|
||||
tags: {
|
||||
some: { OR: options.tags?.map((e) => ({ name: e })) ?? [] },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
search: options.search
|
||||
},
|
||||
description: {
|
||||
search: options.search
|
||||
},
|
||||
content: {
|
||||
search: options.search
|
||||
}
|
||||
}
|
||||
],
|
||||
options.tags
|
||||
? {
|
||||
tags: {
|
||||
some: { OR: options.tags?.map((e) => ({ name: e })) ?? [] },
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
options.search
|
||||
? {
|
||||
title: {
|
||||
search: options.search,
|
||||
},
|
||||
description: {
|
||||
search: options.search,
|
||||
},
|
||||
content: {
|
||||
search: options.search,
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
].filter((e) => e !== undefined),
|
||||
},
|
||||
take: options?.take || 10,
|
||||
skip: options?.skip || 0,
|
||||
@ -75,6 +79,7 @@ class NewsManager {
|
||||
displayName: true,
|
||||
},
|
||||
},
|
||||
tags: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -89,6 +94,7 @@ class NewsManager {
|
||||
displayName: true,
|
||||
},
|
||||
},
|
||||
tags: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user