Skip to content

Commit 6e53d9e

Browse files
committed
tweak
1 parent 1effd0a commit 6e53d9e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

functions/utilities/privacy/router.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ router.get("/student/delay", studentMiddleware, async (req, res) => {
143143

144144
router.post("/student/update", studentMiddleware, async (req, res) => {
145145
try {
146-
const hasGuardianEmails = getGuardianEmails(req.user).length > 0;
147-
146+
const emails = mergeAccountEmailsWithReqBodyGuardianEmails(req, res);
147+
const hasGuardianEmails = emails.some(e => e?.type === 'guardian');
148148
const guardianTouchKey = req.user[userNeedsGuardianTouchKey] || Date.now();
149149

150150
const updateBody = {
151-
emails: mergeAccountEmailsWithReqBodyGuardianEmails(req, res),
151+
emails,
152152
guardianEmail: null,
153153
[guardianPrivacyAuthTokenKey]:
154154
req.user[guardianPrivacyAuthTokenKey] ||

0 commit comments

Comments
 (0)