diff --git a/backend/typescript/rest/userRoutes.ts b/backend/typescript/rest/userRoutes.ts index b191680..ddbcace 100644 --- a/backend/typescript/rest/userRoutes.ts +++ b/backend/typescript/rest/userRoutes.ts @@ -163,21 +163,4 @@ userRouter.delete("/", async (req, res) => { .json({ error: "Must supply one of userId or email as query parameter." }); }); -userRouter.post("/volunteer-signed-up", createUserDtoValidator, async (req, res) => { - try { - const { requestId, userId } = req.body - - const newVolunteerSignedUp = await userService.createSignedUpVolunteers( - requestId, - userId, - ); - - // await authService.sendEmailVerificationLink(req.body.email); - - res.status(201).json(newVolunteerSignedUp); - } catch (error: unknown) { - res.status(500).json({ error: getErrorMessage(error) }); - } -}); - export default userRouter; diff --git a/backend/typescript/services/implementations/requestService.ts b/backend/typescript/services/implementations/requestService.ts index f13d6da..07594e0 100644 --- a/backend/typescript/services/implementations/requestService.ts +++ b/backend/typescript/services/implementations/requestService.ts @@ -1,5 +1,5 @@ -import { Prisma, User, PrismaClient } from '@prisma/client'; -import IRequestSignup from '../interfaces/requestSignup'; +import { Prisma, User } from '@prisma/client'; +import IRequestSignup from '../interfaces/requestService'; import prisma from "../../prisma"; import logger from "../../utilities/logger"; import { getErrorMessage } from "../../utilities/errorUtils"; @@ -8,9 +8,8 @@ const Logger = logger(__filename); class RequestSignup implements IRequestSignup { - private prisma: PrismaClient; - async getRequestSignup(requestId: string): Promise { + async getVolunteerRequestSignup(requestId: string): Promise { try { const volunteerRequestSignUpData = await prisma.volunteerRequestSignUp.findUnique({ where: { @@ -46,7 +45,7 @@ class RequestSignup implements IRequestSignup { } async editRequestSignup(userId: string, updatedData: Prisma.UserUpdateInput): Promise { - const updatedUser = await this.prisma.user.update({ + const updatedUser = await prisma.user.update({ where: { id: userId, }, diff --git a/backend/typescript/services/interfaces/requestSignup.ts b/backend/typescript/services/interfaces/requestService.ts similarity index 91% rename from backend/typescript/services/interfaces/requestSignup.ts rename to backend/typescript/services/interfaces/requestService.ts index 9068cba..81ecbe7 100644 --- a/backend/typescript/services/interfaces/requestSignup.ts +++ b/backend/typescript/services/interfaces/requestService.ts @@ -6,7 +6,7 @@ interface IRequestSignup { * @param requestId - The unique identifier of the request. * @returns A promise that resolves to request data or null if not found. */ - getRequestSignup(requestId: string): Promise; + getVolunteerRequestSignup(requestId: string): Promise; /** * Generate a volunteer shift signup request. diff --git a/backend/typescript/services/interfaces/userService.ts b/backend/typescript/services/interfaces/userService.ts index 3fc855b..7b00d01 100644 --- a/backend/typescript/services/interfaces/userService.ts +++ b/backend/typescript/services/interfaces/userService.ts @@ -91,18 +91,6 @@ interface IUserService { * @throws Error if user deletion fails */ deleteUserByEmail(email: string): Promise; - - /** - * Create a volunteer signed up \ - * @param userId users ID - * @param requestId ID of request from volunteer - * @returns a UserDTO with the created user's information - * @throws Error if user creation fails - */ - createSignedUpVolunteer( - userId: string, - requestId: string, - ): Promise; } export default IUserService;