@@ -324,11 +324,12 @@ export function FeedService() {
324
324
}
325
325
const cacheKey = `search_${ keyword } ` ;
326
326
const searchKeyword = `%${ keyword } %` ;
327
- const feed_list = ( await cache . getOrSet ( cacheKey , ( ) => db . query . feeds . findMany ( {
328
- where : or ( like ( feeds . title , searchKeyword ) ,
327
+ const where = or ( like ( feeds . title , searchKeyword ) ,
329
328
like ( feeds . content , searchKeyword ) ,
330
329
like ( feeds . summary , searchKeyword ) ,
331
- like ( feeds . alias , searchKeyword ) ) ,
330
+ like ( feeds . alias , searchKeyword ) ) ;
331
+ const feed_list = ( await cache . getOrSet ( cacheKey , ( ) => db . query . feeds . findMany ( {
332
+ where : admin ? where : and ( where , eq ( feeds . draft , 0 ) ) ,
332
333
columns : admin ? undefined : {
333
334
draft : false ,
334
335
listed : false
@@ -484,4 +485,4 @@ async function clearFeedCache(id: number, alias: string | null, newAlias: string
484
485
await cache . delete ( `feed_${ alias } ` , false ) ;
485
486
if ( newAlias )
486
487
await cache . delete ( `feed_${ newAlias } ` , false ) ;
487
- }
488
+ }
0 commit comments