Resource update working

This commit is contained in:
Owen Schwartz 2024-10-19 17:41:20 -04:00
parent 9fa25fb0fd
commit 682210c46f
5 changed files with 15 additions and 16 deletions

View file

@ -11,7 +11,7 @@ import logger from '@server/logger';
// Define Zod schema for request parameters validation
const deleteResourceSchema = z.object({
resourceId: z.string().uuid()
resourceId: z.string()
});
export async function deleteResource(req: Request, res: Response, next: NextFunction): Promise<any> {

View file

@ -70,7 +70,7 @@ export async function getResource(req: Request, res: Response, next: NextFunctio
status: HttpCode.OK,
});
} catch (error) {
logger.error(error);
throw error;
return next(createHttpError(HttpCode.INTERNAL_SERVER_ERROR, "An error occurred..."));
}
}

View file

@ -11,7 +11,7 @@ import logger from '@server/logger';
// Define Zod schema for request parameters validation
const updateResourceParamsSchema = z.object({
resourceId: z.string().uuid()
resourceId: z.string()
});
// Define Zod schema for request body validation