-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1543 filter data fetched in recruitmentpositionoverviewpage #1574
base: master
Are you sure you want to change the base?
1543 filter data fetched in recruitmentpositionoverviewpage #1574
Conversation
…itionoverviewpage
…tment overview page and fetches all recruitment application "types" correctly
@@ -1070,26 +1070,40 @@ def put(self, request: Request, pk: int) -> Response: | |||
|
|||
|
|||
class RecruitmentApplicationForRecruitmentPositionView(ModelViewSet): | |||
# TODO: refactor this in ISSUE #1575 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I #1575 skal RecruitmentStatusChoices hentes til frontend, så de definterte filter typene her må endres når det blir gjort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only changes here are refactoring imports and adding prop + implementation of loading state conditional rendering/disable input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just moved
const url = | ||
BACKEND_DOMAIN + | ||
reverse({ | ||
pattern: ROUTES.backend.samfundet__recruitment_applications_for_gang_detail, | ||
urlParams: { pk: recruitmentPositionId }, | ||
pattern: ROUTES.backend.samfundet__recruitment_applications_for_position_detail, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API call was fetching the wrong data
|
||
const params = filterType ? { filter_type: filterType } : {}; | ||
|
||
const response = await axios.get<RecruitmentApplicationDto[]>(url, { | ||
withCredentials: true, | ||
params: params, | ||
}); | ||
|
||
return response.data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds param for filtering in backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored to only fetch data related to the position. Also implemented React Query
The recruitment position overview page is taking a very long time to load when there is a lot of applications for a gang.
The long loading time stems from the fact that ALL applications for the gang is fetched ong the RecruitmentPositionOverviewPage.
This PR sets out to only fetch applications realted to the position, as well as implementing react query here.