Skip to content

Commit

Permalink
Fix student_year type in 2028-specific code
Browse files Browse the repository at this point in the history
This commit fixes the class of 2028 server-specific code so that the `student_year` property from the MIT directory query results is compared to the string `’1’` rather than the number `1`. This corrects a glitch that was assigning class of 2028 members the role for upperclassmen.
  • Loading branch information
ZelnickB committed Sep 15, 2024
1 parent e18446d commit eb5769f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routes/api/verification/confirm.endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function get (req, res) {
const [petrockUserInfo, discordUserInfo] = val[0].value
// BEGIN CLASS OF 2028 SERVER-SPECIFIC CODE
fetch(`https://tlepeopledir.mit.edu/q/${petrockUserInfo.sub}`).then((x) => x.json()).then(directoryResponse => {
if (directoryResponse.result[0] !== undefined && directoryResponse.result[0].student_year === 1) {
if (directoryResponse.result[0] !== undefined && directoryResponse.result[0].student_year === '1') {
fetch(
`https://discord.com/api/v10/guilds/1186456227425828926/members/${discordUserInfo.id}/roles/1186460225943912539`,
{
Expand Down

0 comments on commit eb5769f

Please sign in to comment.