- Created a package list for student packages;
- Updated the group creation wizard to work as a modal;
This commit is contained in:
@@ -5,6 +5,7 @@ import {getFirestore, collection, getDocs, setDoc, doc} from "firebase/firestore
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {Group} from "@/interfaces/user";
|
||||
import {v4} from "uuid";
|
||||
|
||||
const db = getFirestore(app);
|
||||
|
||||
@@ -45,6 +46,6 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
async function post(req: NextApiRequest, res: NextApiResponse) {
|
||||
const body = req.body as Group;
|
||||
|
||||
await setDoc(doc(db, "groups", body.id), {name: body.name, admin: body.admin, participants: body.participants});
|
||||
await setDoc(doc(db, "groups", v4()), {name: body.name, admin: body.admin, participants: body.participants});
|
||||
res.status(200).json({ok: true});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user