finished the public page

This commit is contained in:
daniel31x13
2023-11-19 08:12:37 -05:00
parent b50ec09727
commit 614d92f050
21 changed files with 576 additions and 176 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import getPublicCollection from "@/lib/api/controllers/public/collections/getPublicCollection";
import type { NextApiRequest, NextApiResponse } from "next";
export default async function collections(
export default async function collection(
req: NextApiRequest,
res: NextApiResponse
) {
+13
View File
@@ -0,0 +1,13 @@
import getLinkById from "@/lib/api/controllers/public/links/linkId/getLinkById";
import type { NextApiRequest, NextApiResponse } from "next";
export default async function link(req: NextApiRequest, res: NextApiResponse) {
if (!req?.query?.id) {
return res.status(401).json({ response: "Please choose a valid link." });
}
if (req.method === "GET") {
const link = await getLinkById(Number(req?.query?.id));
return res.status(link.status).json({ response: link.response });
}
}