Skip to content

Commit 03ad5a6

Browse files
committed
feat: enable authorization for /news and /annotations routes
1 parent ca500c7 commit 03ad5a6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/api/routes/annotationsRoute.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import expressUtil from "@util/expressUtil";
99
import {iRequest, iResponse, RouteType} from "@customTypes/expressTypes";
1010
import {MultiAnnotation} from "@customTypes/appDataTypes/annotationTypes";
1111
import AnnotationService from "@services/AnnotationService";
12+
import middlewares from "@api/middlewares";
1213

1314
const route = Router();
1415
const annotationService = new AnnotationService();
@@ -20,7 +21,7 @@ const annotationsRoute: RouteType = (apiRouter) => {
2021
Registering isAuthorized middleware to the entire /users route
2122
as all the endpoint in this route needs authorization.
2223
*/
23-
// route.use(middlewares.isAuthorized);
24+
route.use(middlewares.isAuthorized);
2425

2526
route.get(
2627
"/",

src/api/routes/newsRoute.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ import {
1515
import {
1616
iNewsAnnotationsInputDTO,
1717
iNewsSubmissionDTO,
18-
} from "customTypes/appDataTypes/newsTypes";
18+
} from "@customTypes/appDataTypes/newsTypes";
1919
import {celebrate, Segments} from "celebrate";
2020
import {
2121
newsAnnotationBodySchema,
2222
newsSubmissionBodySchema,
23-
} from "validations/newsRouteSchemas";
24-
import NewsService from "services/NewsService";
23+
} from "@validations/newsRouteSchemas";
24+
import NewsService from "@services/NewsService";
25+
import middlewares from "@api/middlewares";
2526

2627
const route = Router();
2728
const newsService = new NewsService();
@@ -33,7 +34,7 @@ const newsRoute: RouteType = (apiRouter) => {
3334
Registering isAuthorized middleware to the entire /users route
3435
as all the endpoint in this route needs authorization.
3536
*/
36-
// route.use(middlewares.isAuthorized);
37+
route.use(middlewares.isAuthorized);
3738

3839
route.post(
3940
"/",

0 commit comments

Comments
 (0)