Skip to content

Commit

Permalink
feat: enable authorization for /annotations route
Browse files Browse the repository at this point in the history
  • Loading branch information
swalahamani committed Mar 24, 2024
1 parent b83e9e4 commit 24254ee
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/api/routes/annotationsRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import {NextFunction, Router} from "express";

import logger from "@loaders/logger";

// import middlewares from "@api/middlewares";

import expressUtil from "@util/expressUtil";

import {iRequest, iResponse, RouteType} from "@customTypes/expressTypes";
import {MultiAnnotation} from "@customTypes/appDataTypes/annotationTypes";
import AnnotationService from "@services/AnnotationService";
// import middlewares from "@api/middlewares";
import middlewares from "@api/middlewares";

const route = Router();
const annotationService = new AnnotationService();
Expand All @@ -21,7 +19,7 @@ const annotationsRoute: RouteType = (apiRouter) => {
Registering isAuthorized middleware to the entire /users route
as all the endpoint in this route needs authorization.
*/
// route.use(middlewares.isAuthorized);
route.use(middlewares.isAuthorized);

route.get(
"/",
Expand Down Expand Up @@ -59,7 +57,6 @@ const annotationsRoute: RouteType = (apiRouter) => {

return res.status(httpStatusCode).json(result);
} catch (error) {
console.log("🚀 ~ file: annotationsRoute.ts:61 ~ error:", error);
logger.error(uniqueRequestId, "Error on GET:/annotations:", error);

return next(error);
Expand Down

0 comments on commit 24254ee

Please sign in to comment.