Skip to content

Commit 1991974

Browse files
committed
allow cors
1 parent 184f4a5 commit 1991974

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/pages/api/listWatchedVideos.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import WatchedVideo, { IWatchedVideoReqQuery } from "../../models/WatchedVideo"
22
import { NextApiHandler } from "next"
3-
import { connectDb, runMiddleware } from "../../middlewares"
3+
import { connectDb, cors, runMiddleware } from "../../middlewares"
44

55
const listWatchedVideos: NextApiHandler = async (req, res) => {
6+
await runMiddleware(req, res, cors)
67
await runMiddleware(req, res, connectDb)
78

89
const userId = req.query.userId as IWatchedVideoReqQuery["userId"]

0 commit comments

Comments
 (0)