Added SSR
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import {NextApiHandler} from "next";
|
||||
import {Dict, Group} from "../../src/types";
|
||||
import {setGroups} from "../../src/database/groups";
|
||||
import {GroupData, 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)
|
||||
const data = req.body as GroupData
|
||||
|
||||
const uuid = await setGroups(data)
|
||||
res.json({ uuid })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user