Skip to content

Commit

Permalink
fix(apply): defer applying till status received
Browse files Browse the repository at this point in the history
  • Loading branch information
amandesai01 committed Oct 23, 2024
1 parent 78e3945 commit 0f64cdb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/pages/postings/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const id = route.params.id as string;
const { isSignedIn } = useAuth();
const { redirectToLogin } = useSafeRedirectToLogin();
const { data: applicationStatus, refresh: refreshApplicationStatus } = useApplicationStatus(id);
const { data: applicationStatus, refresh: refreshApplicationStatus, status } = useApplicationStatus(id);
const { data: posting } = await usePublicPostingRepository({ id });
const { data: careerSiteConfig } = useCareerSiteConfigObjectState();
Expand Down Expand Up @@ -47,7 +47,11 @@ const apply = async () => {
};
if (route.query.fromOnboard) {
apply();
watch(status, (s) => {
if (s == 'success' && (!applicationStatus.value || !applicationStatus.value.userAlreadyApplied)) {
apply();
}
});
}
</script>

Expand Down

0 comments on commit 0f64cdb

Please sign in to comment.