Skip to content

Commit

Permalink
fix: fetch recruitmentID from getRecruitmentPositionForApplicant inst…
Browse files Browse the repository at this point in the history
…ead of getRecruitmentApplicationForPosition, such that mandatory occupied time field also pops up when recruitmentapplication does not exist yet (a new application)

Related to #1480
  • Loading branch information
amaliejvik committed Oct 31, 2024
1 parent c1b680c commit c04fab0
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function RecruitmentApplicationFormPage() {
getRecruitmentPositionForApplicant(positionId as string)
.then((res) => {
setRecruitmentPosition(res.data);
setRecruitmentId(parseInt(res.data.recruitment));
})
.catch((error) => {
if (error.request.status === STATUS.HTTP_404_NOT_FOUND) {
Expand All @@ -63,8 +64,6 @@ export function RecruitmentApplicationFormPage() {
}),
getRecruitmentApplicationForPosition(positionId as string).then((res) => {
setRecruitmentApplication(res.data);
setRecruitmentId(res.data.recruitment); //Problem del 2: henter recruitmentId fra recruitmentApplication (problem når recruitmentApplication ikke eksisterer)
console.log(res.data);
}),
]).then(() => {
setLoading(false);
Expand Down

0 comments on commit c04fab0

Please sign in to comment.