fetch array at index 0 from ldap

pull/403/head
Rebecca-Chou 9 months ago
parent 3dbc1efe39
commit 0c0515a3c6
  1. 7
      lib/members.ts
  2. 6
      lib/team.ts

@ -43,7 +43,12 @@ export async function getMembers(year: string, term: Term): Promise<Member[]> {
return {
name: item.cn as string,
id: item.uid as string,
program: item.position === undefined ? "" : typeof item.position,
program:
item.position === undefined
? ""
: typeof item.position === "string"
? item.position
: (item.position[0] as string),
};
})
.filter((item: Member) => item.program !== "");

@ -67,7 +67,11 @@ export async function getExecNames() {
return {
name: item.cn as string,
position:
item.position === undefined ? "" : (item.position[0] as string),
item.position === undefined
? ""
: typeof item.position === "string"
? item.position
: (item.position[0] as string),
};
})
.filter((item: ExecMembers) => item.position !== "");

Loading…
Cancel
Save