Skip to content

Commit 4f251dc

Browse files
committed
chore: simplify sql4
Signed-off-by: Xeu <thankrain@qq.com>
1 parent cace53f commit 4f251dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/services/feed.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,12 @@ export function FeedService() {
324324
}
325325
const cacheKey = `search_${keyword}`;
326326
const searchKeyword = `%${keyword}%`;
327-
const where = or(like(feeds.title, searchKeyword),
327+
const whereClause = or(like(feeds.title, searchKeyword),
328328
like(feeds.content, searchKeyword),
329329
like(feeds.summary, searchKeyword),
330330
like(feeds.alias, searchKeyword));
331331
const feed_list = (await cache.getOrSet(cacheKey, () => db.query.feeds.findMany({
332-
where: admin ? where : and(where, eq(feeds.draft, 0)),
332+
where: admin ? whereClause : and(whereClause, eq(feeds.draft, 0)),
333333
columns: admin ? undefined : {
334334
draft: false,
335335
listed: false

0 commit comments

Comments
 (0)