fetch array at index 0 from ldap
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Rebecca-Chou 2022-02-17 10:58:42 +08:00
parent 3dbc1efe39
commit 0c0515a3c6
2 changed files with 11 additions and 2 deletions

View File

@ -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 !== "");

View File

@ -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 !== "");