From ab2db6354f49f9f75f66b8cd31aa8c4358b9255d Mon Sep 17 00:00:00 2001 From: karan Date: Mon, 18 Sep 2023 15:41:56 +0530 Subject: [PATCH] fix: reviewed changes Signed-off-by: karan --- src/api/organization.ts | 4 ++-- src/components/publicProfile/OrgUserInfoLayout.astro | 2 +- .../publicProfile/OrganisationPublicProfile.tsx | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/api/organization.ts b/src/api/organization.ts index c7570b595..0b1098567 100644 --- a/src/api/organization.ts +++ b/src/api/organization.ts @@ -304,7 +304,7 @@ export const createConnection = async (orgName: string) => { // public profile -export const getPublicUsers = async (pageNumber: number, pageSize: number, search = '') => { +export const getPublicUsers = async (pageNumber: number, pageSize: number, search :string) => { const url = `${apiRoutes.public.users}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` @@ -321,7 +321,7 @@ export const getPublicUsers = async (pageNumber: number, pageSize: number, searc } } -export const getPublicOrganizations = async (pageNumber: number, pageSize: number, search = '') => { +export const getPublicOrganizations = async (pageNumber: number, pageSize: number, search :string) => { const url = `${apiRoutes.public.organizations}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` diff --git a/src/components/publicProfile/OrgUserInfoLayout.astro b/src/components/publicProfile/OrgUserInfoLayout.astro index 06c3bf06b..590c996dd 100644 --- a/src/components/publicProfile/OrgUserInfoLayout.astro +++ b/src/components/publicProfile/OrgUserInfoLayout.astro @@ -65,7 +65,7 @@ const { orgUsersData } = Astro.props; : 'text-gray-700 text-sm px-2 py-1 rounded-lg my-1.5 pl-1 bg-red-400' } > - {orgUser?.publicProfile ? 'Public Account' : 'Private Account'} + {orgUser?.publicProfile ? 'Public account' : 'Private account'} {orgUser?.publicProfile && ( diff --git a/src/components/publicProfile/OrganisationPublicProfile.tsx b/src/components/publicProfile/OrganisationPublicProfile.tsx index a8a418c67..65290b303 100644 --- a/src/components/publicProfile/OrganisationPublicProfile.tsx +++ b/src/components/publicProfile/OrganisationPublicProfile.tsx @@ -34,14 +34,14 @@ const OrganisationPublicProfile = () => { const getAllOrganizations = async () => { setLoading(true); const response = await getPublicOrganizations( - currentPage.pageNumber, - currentPage.pageSize, + currentPage?.pageNumber, + currentPage?.pageSize, searchText, ); const { data } = response as AxiosResponse; - if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { + if (data?.statusCode === apiStatusCodes?.API_STATUS_SUCCESS) { const totalPages = data?.data?.totalPages; const orgList = data?.data?.organizations.map((userOrg: any) => { @@ -62,7 +62,7 @@ const OrganisationPublicProfile = () => { useEffect(() => { let getData: NodeJS.Timeout; - if (searchText.length >= 1) { + if (searchText?.length >= 1) { getData = setTimeout(() => { getAllOrganizations(); }, 1000);