add mongo

This commit is contained in:
Sebastian Seedorf
2022-08-17 09:09:49 +02:00
parent 1522962edd
commit fe7e6d8ae2
10 changed files with 326 additions and 2 deletions

13
pages/api/submit.ts Normal file
View File

@@ -0,0 +1,13 @@
import {NextApiHandler} from "next";
import {Dict, Group} from "../../src/types";
import {setGroups} from "../../src/database/groups";
const handler: NextApiHandler = async (req, res) => {
if (req.method !== 'POST') throw new Error('Invalid method')
const {groups, ignored, base} = req.body as {groups: Dict<Group>, ignored: string[], base: string[]}
const uuid = await setGroups(groups, ignored, base)
console.log(uuid)
res.json({ uuid })
}
export default handler