@@ -23,6 +23,9 @@ const Projects = () => {
2323 const projectsFilterByOwner = useTypedSelector (
2424 state => state . createproject . ProjectsFilterByOwner ,
2525 ) ;
26+ const projectFilterByStatus = useTypedSelector (
27+ state => state . createproject . selectedProjectStatus ,
28+ ) ;
2629 const projectSearchKey = useTypedSelector (
2730 state => state . common . projectSearchKey ,
2831 ) ;
@@ -35,16 +38,26 @@ const Projects = () => {
3538 setSetPaginationState ( prev => ( { ...prev , ...value } ) ) ;
3639 } ;
3740
38- // fetch api for projectsList
39- const { data : projectListData , isFetching : isLoading } : Record < string , any > =
40- useGetProjectsListQuery ( {
41- queryKey : {
42- // @ts -ignore
41+ const filterParams = projectFilterByStatus
42+ ? {
4343 filter_by_owner : projectsFilterByOwner === 'yes' ,
44+ status : projectFilterByStatus ,
4445 page : paginationState ?. activePage ,
4546 results_per_page : paginationState ?. selectedNumberOfRows ,
4647 search : projectSearchKey ,
47- } ,
48+ }
49+ : {
50+ filter_by_owner : projectsFilterByOwner === 'yes' ,
51+ page : paginationState ?. activePage ,
52+ results_per_page : paginationState ?. selectedNumberOfRows ,
53+ search : projectSearchKey ,
54+ } ;
55+
56+ // fetch api for projectsList
57+ const { data : projectListData , isFetching : isLoading } : Record < string , any > =
58+ useGetProjectsListQuery ( {
59+ // @ts -ignore
60+ queryKey : { ...filterParams } ,
4861 } ) ;
4962
5063 // fetch project centroid
@@ -65,6 +78,7 @@ const Projects = () => {
6578 return (
6679 < section className = "naxatw-px-3 naxatw-pt-2 lg:naxatw-px-16" >
6780 < ProjectsHeader />
81+
6882 < div className = "naxatw-grid naxatw-gap-2 naxatw-pb-10 md:naxatw-flex md:naxatw-h-[calc(100vh-11rem)] md:naxatw-pb-0" >
6983 < div
7084 className = { `scrollbar naxatw-grid naxatw-grid-rows-[19rem] naxatw-gap-3 naxatw-overflow-y-auto naxatw-py-2 ${ showMap ? 'naxatw-w-full naxatw-grid-cols-1 md:naxatw-w-1/2 md:naxatw-grid-cols-1 lg:naxatw-grid-cols-2 xl:naxatw-grid-cols-3' : 'naxatw-w-full naxatw-grid-cols-1 sm:naxatw-grid-cols-2 md:naxatw-grid-cols-3 lg:naxatw-grid-cols-6' } ` }
0 commit comments