Fix adding group
This commit is contained in:
parent
2120ab9690
commit
9c7ae692f5
@ -34,7 +34,7 @@ export const getGroups = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
export const createGroup = (year_group_id: number, payload: CreateGroup) =>
|
export const createGroup = (year_group_id: number, payload: CreateGroup) =>
|
||||||
axiosInstance.post(`coordinator/groups/${year_group_id}`, payload)
|
axiosInstance.post(`coordinator/groups/${year_group_id}/`, payload)
|
||||||
|
|
||||||
export const deleteGroup = (id: number) =>
|
export const deleteGroup = (id: number) =>
|
||||||
axiosInstance.delete(`coordinator/groups/${id}/`)
|
axiosInstance.delete(`coordinator/groups/${id}/`)
|
||||||
|
@ -33,7 +33,7 @@ const AddGroup = () => {
|
|||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
setStudentOptions(
|
setStudentOptions(
|
||||||
data?.data.students
|
data?.data.students
|
||||||
.filter((st) => st.group === null)
|
// .filter((st) => st.group === null)
|
||||||
.map(({ first_name, last_name, index }) => {
|
.map(({ first_name, last_name, index }) => {
|
||||||
return {
|
return {
|
||||||
value: index,
|
value: index,
|
||||||
@ -51,7 +51,7 @@ const AddGroup = () => {
|
|||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
setSupervisorOptions(
|
setSupervisorOptions(
|
||||||
data?.data.project_supervisors
|
data?.data.project_supervisors
|
||||||
.filter((ld) => ld.count_groups < ld.limit_group)
|
// .filter((ld) => ld.count_groups < ld.limit_group)
|
||||||
.map(({ id, first_name, last_name }) => ({
|
.map(({ id, first_name, last_name }) => ({
|
||||||
value: id,
|
value: id,
|
||||||
label: `${first_name} ${last_name}`,
|
label: `${first_name} ${last_name}`,
|
||||||
|
@ -36,7 +36,7 @@ const EditSchedule = ({
|
|||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
setCommitteeOptions(
|
setCommitteeOptions(
|
||||||
data?.data.project_supervisors
|
data?.data.project_supervisors
|
||||||
.filter((ld) => ld.count_groups < ld.limit_group)
|
// .filter((ld) => ld.count_groups < ld.limit_group)
|
||||||
.map(({ id, first_name, last_name }) => ({
|
.map(({ id, first_name, last_name }) => ({
|
||||||
value: id,
|
value: id,
|
||||||
label: `${first_name} ${last_name}`,
|
label: `${first_name} ${last_name}`,
|
||||||
|
Loading…
Reference in New Issue
Block a user