diff --git a/api/src/routes/applications.ts b/api/src/routes/applications.ts index 5a98f07..9a1a732 100644 --- a/api/src/routes/applications.ts +++ b/api/src/routes/applications.ts @@ -79,9 +79,11 @@ router.get('/me', [requireLogin], async (req, res) => { try { let application = await getMemberApplication(userID); - - if (application === undefined) + + if (application === undefined) { res.sendStatus(204); + return; + } const comments: CommentRow[] = await getApplicationComments(application.id); diff --git a/ui/src/pages/Application.vue b/ui/src/pages/Application.vue index 428d52c..e4c8d88 100644 --- a/ui/src/pages/Application.vue +++ b/ui/src/pages/Application.vue @@ -20,6 +20,7 @@ const decisionDate = ref(null); const submitDate = ref(null); const loading = ref(true); const member_name = ref(); +const notFound = ref(false); const props = defineProps<{ mode?: "create" | "view-self" | "view-recruiter" | "view-self-id" @@ -29,6 +30,11 @@ const finalMode = ref<"create" | "view-self" | "view-recruiter" | "view-self-id" function loadData(raw: ApplicationFull) { + if (!raw) { + notFound.value = true; + return; + } + const data = raw.application; appID.value = data.id; @@ -129,6 +135,10 @@ async function handleDeny(id) {
You do not have permission to view this application.
+
+ Looks like you dont have an application, reach out to the administration team if you believe this is an + error. +
@@ -181,8 +191,7 @@ async function handleDeny(id) {
-
- +
\ No newline at end of file