add
This commit is contained in:
parent
dc24523bf8
commit
da5d6f635b
|
@ -5,16 +5,13 @@ import { useMemo } from "react";
|
|||
import PathCard from "./PathCard";
|
||||
|
||||
export function PathListContainer() {
|
||||
const { searchValue, selectedTerms } = useMainContext();
|
||||
const { searchValue, selectedTerms, searchCondition } = useMainContext();
|
||||
const termFilters = useMemo(() => {
|
||||
return Object.entries(selectedTerms)
|
||||
.filter(([, terms]) => terms.length > 0)
|
||||
.map(([, terms]) => terms);
|
||||
}, [selectedTerms]);
|
||||
const searchCondition: Prisma.StringNullableFilter = {
|
||||
contains: searchValue,
|
||||
mode: "insensitive" as Prisma.QueryMode, // 使用类型断言
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<PostList
|
||||
|
@ -32,18 +29,7 @@ export function PathListContainer() {
|
|||
},
|
||||
},
|
||||
})),
|
||||
OR: [
|
||||
{ title: searchCondition },
|
||||
{ subTitle: searchCondition },
|
||||
{ content: searchCondition },
|
||||
{
|
||||
terms: {
|
||||
some: {
|
||||
name: searchCondition,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
...searchCondition,
|
||||
},
|
||||
}}
|
||||
cols={4}></PostList>
|
||||
|
|
Loading…
Reference in New Issue