merge with frontend schedule view updates
This commit is contained in:
commit
75deaab904
@ -60,7 +60,7 @@ export const getAvailabilityForCoordinator = (scheduleId: number) => {
|
|||||||
}>(`coordinator/enrollments/${scheduleId}/temporary-availabilities`)
|
}>(`coordinator/enrollments/${scheduleId}/temporary-availabilities`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getSchedules = (year_group_id: number = 1) => {
|
export const getSchedules = (year_group_id: number) => {
|
||||||
return axiosInstance.get<{
|
return axiosInstance.get<{
|
||||||
examination_schedules: {
|
examination_schedules: {
|
||||||
id: number
|
id: number
|
||||||
|
@ -138,6 +138,7 @@ const Schedule = () => {
|
|||||||
const eventsCopy = [...events]
|
const eventsCopy = [...events]
|
||||||
eventsCopy[index] = {
|
eventsCopy[index] = {
|
||||||
...eventsCopy[index],
|
...eventsCopy[index],
|
||||||
|
title: term.group.name,
|
||||||
resource: {
|
resource: {
|
||||||
...eventsCopy[index].resource,
|
...eventsCopy[index].resource,
|
||||||
group: term.group,
|
group: term.group,
|
||||||
|
@ -18,7 +18,7 @@ const Schedules = () => {
|
|||||||
const [endDate, setEndDate] = useState(new Date())
|
const [endDate, setEndDate] = useState(new Date())
|
||||||
|
|
||||||
const { data: schedules, refetch } = useQuery(['getSchedules'], () =>
|
const { data: schedules, refetch } = useQuery(['getSchedules'], () =>
|
||||||
getSchedules(),
|
getSchedules(Number(yearGroupId)),
|
||||||
)
|
)
|
||||||
|
|
||||||
const { mutate: mutateCreateSchedule } = useMutation(
|
const { mutate: mutateCreateSchedule } = useMutation(
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
import { useQuery } from 'react-query'
|
import { useQuery } from 'react-query'
|
||||||
import { getSchedules } from '../../api/schedule'
|
import { getSchedules } from '../../api/schedule'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
import useLocalStorageState from 'use-local-storage-state'
|
||||||
|
|
||||||
const SupervisorAvailabilities = () => {
|
const SupervisorAvailabilities = () => {
|
||||||
const { data: schedules } = useQuery(['getSchedules'], () => getSchedules())
|
const [yearGroupId] = useLocalStorageState('yearGroupId')
|
||||||
|
|
||||||
|
const { data: schedules } = useQuery(['getSchedules'], () =>
|
||||||
|
getSchedules(Number(yearGroupId)),
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
import { useQuery } from 'react-query'
|
import { useQuery } from 'react-query'
|
||||||
import { getSchedules } from '../../api/schedule'
|
import { getSchedules } from '../../api/schedule'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
import useLocalStorageState from 'use-local-storage-state'
|
||||||
|
|
||||||
const StudentSchedules = () => {
|
const StudentSchedules = () => {
|
||||||
const { data: schedules } = useQuery(['getSchedules'], () => getSchedules())
|
const [yearGroupId] = useLocalStorageState('yearGroupId')
|
||||||
|
|
||||||
|
const { data: schedules } = useQuery(['getSchedules'], () =>
|
||||||
|
getSchedules(Number(yearGroupId)),
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
import { useQuery } from 'react-query'
|
import { useQuery } from 'react-query'
|
||||||
import { getSchedules } from '../../api/schedule'
|
import { getSchedules } from '../../api/schedule'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
import useLocalStorageState from 'use-local-storage-state'
|
||||||
|
|
||||||
const SupervisorSchedules = () => {
|
const SupervisorSchedules = () => {
|
||||||
const { data: schedules } = useQuery(['getSchedules'], () => getSchedules())
|
const [yearGroupId] = useLocalStorageState('yearGroupId')
|
||||||
|
|
||||||
|
const { data: schedules } = useQuery(['getSchedules'], () =>
|
||||||
|
getSchedules(Number(yearGroupId)),
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
Reference in New Issue
Block a user