From 4741025dcbd539b859eeb17f6f79035300a54fd1 Mon Sep 17 00:00:00 2001 From: pramod mahajan Date: Wed, 10 Sep 2025 20:35:48 +0530 Subject: [PATCH] set Directory page for project --- src/pages/Directory/ContactsPage.jsx | 4 ++-- src/pages/Directory/DirectoryPage.jsx | 21 ++++++++++++--------- src/repositories/DirectoryRepository.jsx | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/pages/Directory/ContactsPage.jsx b/src/pages/Directory/ContactsPage.jsx index 75a8a142..6dd0dfc0 100644 --- a/src/pages/Directory/ContactsPage.jsx +++ b/src/pages/Directory/ContactsPage.jsx @@ -12,14 +12,14 @@ import ListViewContact from "../../components/Directory/ListViewContact"; import { CardViewContactSkeleton, ListViewContactSkeleton } from "../../components/Directory/DirectoryPageSkeleton"; -const ContactsPage = ({ searchText }) => { +const ContactsPage = ({projectId ,searchText }) => { const [currentPage, setCurrentPage] = useState(1); const [filters, setFilter] = useState(defaultContactFilter); const debouncedSearch = useDebounce(searchText, 500); const { showActive, gridView } = useDirectoryContext(); const { data, isError, isLoading, error } = useContactList( showActive, - null, + projectId, ITEMS_PER_PAGE, currentPage, filters, diff --git a/src/pages/Directory/DirectoryPage.jsx b/src/pages/Directory/DirectoryPage.jsx index 273a948e..2ad7bc0f 100644 --- a/src/pages/Directory/DirectoryPage.jsx +++ b/src/pages/Directory/DirectoryPage.jsx @@ -32,7 +32,7 @@ export const useDirectoryContext = () => { } return context; }; -export default function DirectoryPage({ IsPage = true, projectId }) { +export default function DirectoryPage({ IsPage = true, projectId=null }) { const [searchContact, setsearchContact] = useState(""); const [searchNote, setSearchNote] = useState(""); const [activeTab, setActiveTab] = useState("notes"); @@ -94,13 +94,13 @@ export default function DirectoryPage({ IsPage = true, projectId }) { return ( <> -
- + {IsPage && ( + >)}
    @@ -188,7 +188,7 @@ export default function DirectoryPage({ IsPage = true, projectId }) {
-
+
setShowActive(e.target.checked)} /> -
@@ -211,10 +214,10 @@ export default function DirectoryPage({ IsPage = true, projectId }) {
}> {activeTab === "notes" && ( - + )} {activeTab === "contacts" && ( - + )}
diff --git a/src/repositories/DirectoryRepository.jsx b/src/repositories/DirectoryRepository.jsx index b41ed411..9f8996c4 100644 --- a/src/repositories/DirectoryRepository.jsx +++ b/src/repositories/DirectoryRepository.jsx @@ -56,7 +56,7 @@ export const DirectoryRepository = { const payloadJsonString = JSON.stringify(filter); return api.get( `/api/directory/notes?` + - (projectId ? `projectId=${projectId}` : "&") + + (projectId ? `projectId=${projectId}&` : "&") + `pageSize=${pageSize}&pageNumber=${pageNumber}&filter=${encodeURIComponent( payloadJsonString )}&searchString=${encodeURIComponent(searchString)}`