ENCOA-90: Updated the instances of Level test to use the Grading System
This commit is contained in:
@@ -34,7 +34,8 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
const snapshot = await getDoc(doc(db, "grading", req.session.user.id));
|
||||
if (snapshot.exists()) return res.status(200).json(snapshot.data());
|
||||
|
||||
if (req.session.user.type !== "teacher" && req.session.user.type !== "student") return res.status(200).json(CEFR_STEPS);
|
||||
if (req.session.user.type !== "teacher" && req.session.user.type !== "student")
|
||||
return res.status(200).json({steps: CEFR_STEPS, user: req.session.user.id});
|
||||
|
||||
const corporate = await getUserCorporate(req.session.user.id);
|
||||
if (!corporate) return res.status(200).json(CEFR_STEPS);
|
||||
@@ -42,7 +43,7 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
|
||||
const corporateSnapshot = await getDoc(doc(db, "grading", corporate.id));
|
||||
if (corporateSnapshot.exists()) return res.status(200).json(snapshot.data());
|
||||
|
||||
return res.status(200).json(CEFR_STEPS);
|
||||
return res.status(200).json({steps: CEFR_STEPS, user: req.session.user.id});
|
||||
}
|
||||
|
||||
async function post(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
Reference in New Issue
Block a user