Skip to content

Commit

Permalink
cleaned up docker errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmendoza committed Oct 30, 2023
1 parent 6268003 commit 4754bba
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 35 deletions.
17 changes: 0 additions & 17 deletions backend/typescript/rest/userRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
9 changes: 4 additions & 5 deletions backend/typescript/services/implementations/requestService.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -8,9 +8,8 @@ const Logger = logger(__filename);


class RequestSignup implements IRequestSignup {
private prisma: PrismaClient;

async getRequestSignup(requestId: string): Promise<Prisma.volunteerRequestSignUp | null> {
async getVolunteerRequestSignup(requestId: string): Promise<Prisma.volunteerRequestSignUp | null> {
try {
const volunteerRequestSignUpData = await prisma.volunteerRequestSignUp.findUnique({
where: {
Expand Down Expand Up @@ -46,7 +45,7 @@ class RequestSignup implements IRequestSignup {
}

async editRequestSignup(userId: string, updatedData: Prisma.UserUpdateInput): Promise<User> {
const updatedUser = await this.prisma.user.update({
const updatedUser = await prisma.user.update({
where: {
id: userId,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Prisma.volunteerRequestSignUp | null>;
getVolunteerRequestSignup(requestId: string): Promise<Prisma.volunteerRequestSignUp | null>;

/**
* Generate a volunteer shift signup request.
Expand Down
12 changes: 0 additions & 12 deletions backend/typescript/services/interfaces/userService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@ interface IUserService {
* @throws Error if user deletion fails
*/
deleteUserByEmail(email: string): Promise<void>;

/**
* 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<void>;
}

export default IUserService;

0 comments on commit 4754bba

Please sign in to comment.