Refactored evaluation process for improved efficiency:
- Initial response set to null; Frontend now generates a list of anticipated stats; - Background evaluation dynamically updates DB upon completion; - Frontend actively monitors and finalizes upon stat evaluation completion.
This commit is contained in:
@@ -42,7 +42,7 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
|
||||
}
|
||||
|
||||
const stats = req.body as Stat[];
|
||||
await stats.forEach(async (stat) => await addDoc(collection(db, "stats"), stat));
|
||||
await stats.forEach(async (stat) => await setDoc(doc(db, "stats", stat.id), stat));
|
||||
|
||||
const groupedStatsByAssignment = groupBy(
|
||||
stats.filter((x) => !!x.assignment),
|
||||
|
||||
Reference in New Issue
Block a user