Created an e-mail type to be sent to the ticket reporter with the ticket's information
This commit is contained in:
@@ -45,11 +45,6 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
async function post(req: NextApiRequest, res: NextApiResponse) {
|
||||
const body = req.body as Invite;
|
||||
|
||||
const shortUID = new ShortUniqueId();
|
||||
await setDoc(doc(db, "invites", body.id || shortUID.randomUUID(8)), body);
|
||||
|
||||
res.status(200).json({ ok: true });
|
||||
|
||||
const invitedRef = await getDoc(doc(db, "users", body.to));
|
||||
if (!invitedRef.exists()) return res.status(404).json({ ok: false });
|
||||
|
||||
@@ -76,4 +71,9 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
const shortUID = new ShortUniqueId();
|
||||
await setDoc(doc(db, "invites", body.id || shortUID.randomUUID(8)), body);
|
||||
|
||||
res.status(200).json({ ok: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user