Skip to content

Commit

Permalink
bruh
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanDing26 committed Apr 24, 2024
1 parent 1dd9163 commit 7b1dbb4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions api/controllers/AdminController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
CreateMilestoneResponse,
CreateBonusResponse,
UploadBannerResponse,
GetAllNamesEmailsResponse,
GetAllNamesAndEmailsResponse,
SubmitAttendanceForUsersResponse,
ModifyUserAccessLevelResponse,
GetAllUserAccessLevelsResponse,
Expand Down Expand Up @@ -41,9 +41,9 @@ export class AdminController {
}

@Get('/email')
async getAllNamesEmails(@AuthenticatedUser() user: UserModel): Promise<GetAllNamesEmailsResponse> {
async getAllNamesAndEmails(@AuthenticatedUser() user: UserModel): Promise<GetAllNamesAndEmailsResponse> {
if (!PermissionsService.canSeeAllUserEmails(user)) throw new ForbiddenError();
const namesEmails = await this.userAccountService.getAllNamesEmails();
const namesEmails = await this.userAccountService.getAllNamesAndEmails();
return { error: null, namesEmails };
}

Expand Down
2 changes: 1 addition & 1 deletion tests/admin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('names and emails retrieval', () => {
.createUsers(...users, admin)
.write();

const response = await ControllerFactory.admin(conn).getAllNamesEmails(admin);
const response = await ControllerFactory.admin(conn).getAllNamesAndEmails(admin);
const expected: NameAndEmail = { firstName: admin.firstName, lastName: admin.lastName, email: admin.email };
expect(expect.arrayContaining(response.namesEmails)).toEqual([...namesEmails,
expected]);
Expand Down
2 changes: 1 addition & 1 deletion types/ApiResponses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface UploadBannerResponse extends ApiResponse {
banner: string;
}

export interface GetAllNamesEmailsResponse extends ApiResponse {
export interface GetAllNamesAndEmailsResponse extends ApiResponse {
namesEmails: NameAndEmail[];
}

Expand Down

0 comments on commit 7b1dbb4

Please sign in to comment.