diff --git a/src/api/invitations.ts b/src/api/invitations.ts index 9fd30583f..28303043e 100644 --- a/src/api/invitations.ts +++ b/src/api/invitations.ts @@ -208,7 +208,7 @@ export const getEcosystemInvitations = async (pageNumber: number, pageSize: numb const ecosystemId = await getFromLocalStorage(storageKeys.ECOSYSTEM_ID); const orgId = await getFromLocalStorage(storageKeys.ORG_ID); - const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.invitations}` + const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.invitations}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}` const token = await getFromLocalStorage(storageKeys.TOKEN) diff --git a/src/components/Ecosystem/MemberList.tsx b/src/components/Ecosystem/MemberList.tsx index a7d815a8a..2ab2656df 100644 --- a/src/components/Ecosystem/MemberList.tsx +++ b/src/components/Ecosystem/MemberList.tsx @@ -30,22 +30,23 @@ const MemberList = () => { const { data } = response as AxiosResponse; if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) { const totalPages = data?.data?.totalPages; - - const compareMembers=( - firstMember: { ecosystemRole: { name: string; }; }, + + const compareMembers = ( + firstMember: { ecosystemRole: { name: string; }; }, secondMember: { ecosystemRole: { name: string; }; } - )=> { + ) => { const firstName = firstMember?.ecosystemRole?.name; const secondName = secondMember?.ecosystemRole?.name; - if (firstName > secondName) { - return 1; - } else if (secondName > firstName) { - return -1; - } else { - return 0; + switch (true) { + case firstName > secondName: + return 1; + case secondName > firstName: + return -1; + default: + return 0; } - } + }; const sortedMemberList = data?.data?.members?.sort(compareMembers) const membersData = sortedMemberList?.map( (member: { @@ -58,7 +59,7 @@ const MemberList = () => { return { data: [ { - data: member.orgName || 'Not avilable', + data: member.orgName || 'Not available', }, { data: @@ -176,7 +177,7 @@ const MemberList = () => { loading={loading} > - {currentPage.pageNumber > 1 && ( + {currentPage.total > 1 && (
{ ) )} - {currentPage.pageNumber > 1 &&
+ {currentPage.total > 1 &&
{
)} - {currentPage.pageNumber >1 && ( + {currentPage.total > 1 && (
) : ( -
- {walletStatus ? - - : - - - } - onClick={() => { - window.location.href = `${pathRoutes.organizations.dashboard}?OrgId=${orgId}` - }} - />} -
) }