From 7fe646a87582e0a19ea6051b3e93e7bb6f0224c2 Mon Sep 17 00:00:00 2001 From: adam-skowronek Date: Tue, 3 Jan 2023 22:51:07 +0100 Subject: [PATCH] Add studentId --- frontend/src/views/Login.tsx | 34 ++++++++++++------- .../src/views/student/ScheduleAddGroup.tsx | 2 +- .../src/views/student/StudentSchedule.tsx | 2 +- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/frontend/src/views/Login.tsx b/frontend/src/views/Login.tsx index 499e6b0..38881fe 100644 --- a/frontend/src/views/Login.tsx +++ b/frontend/src/views/Login.tsx @@ -22,6 +22,8 @@ const Login = () => { const [userId, setUserId] = useLocalStorageState('userId', { defaultValue: -1, }) + const [studentId, setStudentId] = useLocalStorageState('studentId') + const [userType, setUserType] = useLocalStorageState('userType', { defaultValue: 'coordinator', }) @@ -66,19 +68,22 @@ const Login = () => { { onSuccess: (data) => { setLeaderOptions( - data?.data.project_supervisors.map(({ first_name, last_name, id }) => { - return { - value: id, - label: `${first_name} ${last_name}`, - } - }), + data?.data.project_supervisors.map( + ({ first_name, last_name, id }) => { + return { + value: id, + label: `${first_name} ${last_name}`, + } + }, + ), ) }, }, ) const onStudentChange = (v: any) => { - setUserId(v.value) + setStudentId(v.value) + // setUserId(v.value) setUserType('student') } @@ -131,7 +136,7 @@ const Login = () => {