update: changes to endpoint getAllAnswers in assessments

This commit is contained in:
falendikategar 2024-11-07 10:23:58 +07:00
parent de20b5a0bb
commit 663c3039bc

View File

@ -430,14 +430,14 @@ const assessmentsRoute = new Hono<HonoEnv>()
) )
.get( .get(
"/getAllAnswers/:id", // Use :assessmentId in the URL path "/getAllAnswers/:assessmentId", // Use :assessmentId in the URL path
checkPermission("assessments.readAnswers"), checkPermission("assessments.readAnswers"),
async (c) => { async (c) => {
const assessmentId = c.req.param("id"); // Retrieve assessmentId from the URL const assessmentId = c.req.param("assessmentId"); // Retrieve assessmentId from the URL
if (!assessmentId) { // if (!assessmentId) {
return c.json({ error: "assessmentId is required" }, 400); // return c.json({ error: "assessmentId is required" }, 400);
} // }
// Query to retrieve answers for the specific assessmentId // Query to retrieve answers for the specific assessmentId
const result = await db const result = await db