Skip to content

Commit

Permalink
resolve : types errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-bansal-7 committed Nov 20, 2024
1 parent f19cf8b commit 90e6e02
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/screens/UserPortal/People/People.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ export default function people(): JSX.Element {

useEffect(() => {
if (data && data2) {
interface Admin {
_id: string;
}
const adminIds = data2.organizations[0].admins.map(
(admin: any) => admin._id,
(admin: Admin) => admin._id,
);

const updatedMembers = data.organizationsMemberConnection.edges.map(
Expand Down Expand Up @@ -166,9 +169,12 @@ export default function people(): JSX.Element {
}
} else if (mode == 1) {
if (data2) {
const admins = data2.organizations[0].admins.map((admin: any) => {
return { ...admin, userType: 'Admin' };
});
const admins = data2.organizations[0].admins.map(
(admin: InterfaceMember) => ({
...admin,
userType: 'Admin' as const,
}),
);
setMembers(admins);
}
}
Expand Down

0 comments on commit 90e6e02

Please sign in to comment.