final fix

ldap-exec-test
Rebecca-Chou 9 months ago
parent 00caa70143
commit cafdf334fe
  1. 17
      lib/team.ts

@ -95,28 +95,25 @@ export async function getExec(name: string, pos: string, convert = true) {
const raw = await readFile(path.join(EXECS_PATH, `${name}${fileType}`));
({ content, data: metadata } = matter(raw));
const image =
(metadata.image as string | undefined) ??
(await getMemberImagePath(metadata.name));
const image = await getMemberImagePath(metadata.name);
return {
content: convert ? await serialize(content) : content,
metadata: { ...metadata, image } as Metadata,
};
} catch (err) {
// Capitalize the first letter of the first name and last name
const firstName =
name.split("-")[0][0].toUpperCase() + name.split("-")[0].slice(1);
const lastName =
name.split("-")[1][0].toUpperCase() + name.split("-")[1].slice(1);
const posName = execPositions[pos];
({ content, metadata } = {
content: "Coming soon!",
metadata: {
name: `${firstName} ${lastName}`,
role: `${posName}`,
},
});
content = "Coming Soon";
metadata = {
name: `${firstName} ${lastName}`,
role: `${posName}`,
};
const image = await getMemberImagePath(metadata.name);

Loading…
Cancel
Save