Skip to content

Commit

Permalink
⚡️ feat: Modify the get sector attendance to match the required behav…
Browse files Browse the repository at this point in the history
…iour
  • Loading branch information
akramhany committed Dec 28, 2023
1 parent 174fabb commit 192a640
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/controllers/attendance.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@ const attendanceController = {
const { baseName, suffixName, weekNumber, termNumber } = req.query

const result = await db.query(`
SELECT "ScoutAttendance".*
FROM "Scout", "ScoutAttendance"
WHERE "Scout"."sectorBaseName" = $1 AND "Scout"."sectorSuffixName" = $2
SELECT "Scout".*, "ScoutAttendance".* FROM "Scout" LEFT JOIN "ScoutAttendance" ON "Scout"."scoutId" = "ScoutAttendance"."scoutId"
AND "ScoutAttendance"."weekNumber" = $3 AND "ScoutAttendance"."termNumber" = $4
AND "ScoutAttendance"."scoutId" = "Scout"."scoutId";
INNER JOIN "Sector" ON "Sector"."baseName" = "Scout"."sectorBaseName" AND "Sector"."suffixName" = "Scout"."sectorSuffixName"
WHERE "Sector"."baseName" = $1 AND "Sector"."suffixName" = $2;
`,
[baseName, suffixName, weekNumber, termNumber])

Expand Down

0 comments on commit 192a640

Please sign in to comment.