feat: add collection functionality

This commit is contained in:
Daniel
2023-04-25 01:00:40 +03:30
parent b02766f6c8
commit 4bfb08a52e
12 changed files with 86 additions and 134 deletions
+1 -4
View File
@@ -22,10 +22,7 @@ export default async function (req: NextApiRequest, res: NextApiResponse) {
.status(collections.status)
.json({ response: collections.response });
} else if (req.method === "POST") {
const newCollection = await postCollection(
req.body.collectionName.trim(),
session.user.id
);
const newCollection = await postCollection(req.body, session.user.id);
return res
.status(newCollection.status)
.json({ response: newCollection.response });