Skip to content

Commit

Permalink
Merge pull request #4 from HighlanderRobotics/other-role
Browse files Browse the repository at this point in the history
Add "other" role
  • Loading branch information
MangoSwirl authored Jan 7, 2024
2 parents 18ac46d + c897b9a commit 683bf67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/lib/util/person/role/localized.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export const localizedRole = (role: string) =>
import type { Role } from "./roles";

export const localizedRole = (role: Role) =>
({
student: 'Student',
mentor: 'Mentor'
mentor: 'Mentor',
other: 'Other',
}[role] ?? role);
4 changes: 2 additions & 2 deletions src/lib/util/person/role/roles.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const roles = ['student', 'mentor'];
export const roles = ['student', 'mentor', 'other'] as const;

export type Role = 'student' | 'mentor';
export type Role = typeof roles[number];

0 comments on commit 683bf67

Please sign in to comment.