Add studentId
This commit is contained in:
parent
5d999ea9c8
commit
7fe646a875
@ -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 }) => {
|
||||
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 = () => {
|
||||
<Select
|
||||
closeMenuOnSelect={true}
|
||||
options={leaderOptions}
|
||||
placeholder="Wybierz studenta"
|
||||
placeholder="Wybierz opiekuna"
|
||||
onChange={onLeaderChange}
|
||||
styles={{
|
||||
control: (styles: any) => ({
|
||||
@ -162,10 +167,15 @@ const Login = () => {
|
||||
Zaloguj
|
||||
</button>
|
||||
<div className="flex flex-col mt-3">
|
||||
<span onClick={() => {
|
||||
<span
|
||||
onClick={() => {
|
||||
setUserType('coordinator')
|
||||
navigate("/coordinator")
|
||||
}} className="cursor-pointer">Koordynator</span>
|
||||
navigate('/coordinator')
|
||||
}}
|
||||
className="cursor-pointer"
|
||||
>
|
||||
Koordynator
|
||||
</span>
|
||||
{/* <NavLink to="/student">Student</NavLink> */}
|
||||
{/* <NavLink to="/supervisor">Opiekun</NavLink> */}
|
||||
</div>
|
||||
|
@ -23,7 +23,7 @@ const ScheduleAddGroup = ({
|
||||
const { register, handleSubmit, reset, control } = useForm<{
|
||||
student_index: number
|
||||
}>({ mode: 'onBlur' })
|
||||
const [studentId] = useLocalStorageState('userId')
|
||||
const [studentId] = useLocalStorageState('studentId')
|
||||
|
||||
const { mutate: mutateAssignGroup } = useMutation(
|
||||
['assignGroup'],
|
||||
|
@ -24,7 +24,7 @@ const customStyles = {
|
||||
const localizer = dayjsLocalizer(dayjs)
|
||||
|
||||
const StudentSchedule = () => {
|
||||
const [studentId] = useLocalStorageState('userId')
|
||||
const [studentId] = useLocalStorageState('studentId')
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const [events, setEvents] = useState<
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user