Skip to content

Commit

Permalink
Change remove_clubs_from_exception to detail=false, fix checkbox stat…
Browse files Browse the repository at this point in the history
…e management
  • Loading branch information
julianweng committed Dec 1, 2023
1 parent 901bea1 commit 4a817c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion backend/clubs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5098,7 +5098,7 @@ def add_clubs_to_exception(self, *args, **kwargs):
)
return Response([])

@action(detail=True, methods=["post"])
@action(detail=False, methods=["post"])
def remove_clubs_from_exception(self, *args, **kwargs):
"""
Remove selected clubs from application cycle deadline exemption
Expand Down
15 changes: 6 additions & 9 deletions frontend/components/Settings/WhartonApplicationCycles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,10 @@ const WhartonApplicationCycles = (): ReactElement => {
})
}
if (clubsNoExceptions.length > 0) {
doApiRequest(
`/cycles/${extensionsCycle.id}/remove_clubs_from_exception/`,
{
method: 'POST',
body: { clubs: clubsNoExceptions.map((x) => x.id) },
},
)
doApiRequest(`/cycles/remove_clubs_from_exception/`, {
method: 'POST',
body: { clubs: clubsNoExceptions.map((x) => x.id) },
})
}
}

Expand All @@ -132,7 +129,7 @@ const WhartonApplicationCycles = (): ReactElement => {
}),
)
})
}, [clubOptionsMembership])
}, [])

useEffect(() => {
if (membershipCycle && membershipCycle.id != null) {
Expand Down Expand Up @@ -264,13 +261,13 @@ const WhartonApplicationCycles = (): ReactElement => {
setClubsExtensions([...clubsExtensions])
}}
/>
{/* {club.endDate} */}
</td>
<td>
<Checkbox
onChange={(e) => {
club.exception = e.target.checked
club.changed = true
setClubsExtensions([...clubsExtensions])
}}
checked={
club.exception != null ? club.exception : false
Expand Down

0 comments on commit 4a817c6

Please sign in to comment.