Updated a bit more of the way the codes work

This commit is contained in:
Tiago Ribeiro
2023-10-10 21:17:46 +01:00
parent 0c9a49a9c3
commit 1aa4f0ddfd
9 changed files with 73 additions and 61 deletions

View File

@@ -29,7 +29,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
const codePromises = codes.map(async (code, index) => {
const codeRef = doc(db, "codes", code);
await setDoc(codeRef, {type, code});
await setDoc(codeRef, {type, code, creator: req.session.user!.id});
if (emails && emails.length > index) {
const transport = prepareMailer();