Skip to content
Merged

Dev #31

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions src/repository/user/userRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,12 @@ export class UserRepository {
}

async findExists(studentId: string, citizenId: string): Promise<boolean> {
const userFromStudentId = await prisma.user.findFirst({
where: {
studentId: studentId,
},
});
if (userFromStudentId) {
return true;
}
const userFromCitizenId = await prisma.user.findFirst({
const user = await prisma.user.findFirst({
where: {
citizenId: citizenId,
AND: [{ studentId: studentId }, { citizenId: citizenId }],
},
});
if (userFromCitizenId) {
if (user) {
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/router/groupRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class GroupRouter extends BaseRouter {
this.groupController.setHousePreferences.bind(this.groupController)
);

this.router.get(
this.router.post(
"/groupByInviteCode",
this.groupController.getGroupByInviteCode.bind(this.groupController)
);
Expand Down
2 changes: 1 addition & 1 deletion src/usecase/auth/authUsecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class AuthUsecase {
);
if (existingUser) {
throw new AppError(
"User with this student ID or citizen ID already exists",
"User with this student ID and citizen ID already exists",
400
);
}
Expand Down