Added tag support + Post link and many more changes and optimizations.
This commit is contained in:
@@ -2,13 +2,13 @@ import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { getServerSession } from "next-auth/next";
|
||||
import { authOptions } from "pages/api/auth/[...nextauth]";
|
||||
import getCollections from "@/lib/api/controllers/collections/getCollections";
|
||||
import postCollections from "@/lib/api/controllers/collections/postCollection";
|
||||
import postCollection from "@/lib/api/controllers/collections/postCollection";
|
||||
|
||||
type Data = {
|
||||
response: object[] | string;
|
||||
};
|
||||
|
||||
export default async function handler(
|
||||
export default async function (
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse<Data>
|
||||
) {
|
||||
@@ -20,5 +20,5 @@ export default async function handler(
|
||||
|
||||
if (req.method === "GET") return await getCollections(req, res, session);
|
||||
|
||||
if (req.method === "POST") return await postCollections(req, res, session);
|
||||
if (req.method === "POST") return await postCollection(req, res, session);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user