Files
gongxue-base/apps/admin/src/pages/Deposits/deposit-student-option.ts

14 lines
401 B
TypeScript

export interface DepositStudentLookup {
id: number;
name: string;
studentNo?: string | null;
}
export const buildDepositStudentOption = (student: DepositStudentLookup) => ({
value: student.id,
label: `${student.name} (${student.studentNo || `#${student.id}`})`,
});
export const buildDepositStudentOptions = (students: DepositStudentLookup[]) =>
students.map(buildDepositStudentOption);