From d171555e6c140efa9c1381e7ea3af7ff0ec19922 Mon Sep 17 00:00:00 2001 From: Jonathan Sun Date: Tue, 27 Sep 2022 02:10:36 -0700 Subject: [PATCH] updated school options and fixed pkey issue with register --- client/src/components/SignUp.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/components/SignUp.js b/client/src/components/SignUp.js index 1d3905d0..68a42748 100755 --- a/client/src/components/SignUp.js +++ b/client/src/components/SignUp.js @@ -46,6 +46,13 @@ const SignUp = () => { .then(res => res.json()) .then( sites => { + sites.sort((a, b) => { + if (a.id < b.id) { + return -1 + } + return 1 + }) + console.log(sites) setSites(sites); }, error => { @@ -127,7 +134,7 @@ const SignUp = () => { event.preventDefault(); return; } - + console.log(sites[siteId-1].schoolName) if (role === 'student' && siteCode !== sites[siteId - 1].schoolName + 'ANova') { Modal.error({ title: 'Wrong Site Access Code!',