Merge pull request '132-view-empty-application-fix' (#137) from 132-view-empty-application-fix into main
Some checks failed
Continuous Integration / Update Development (push) Has been cancelled
Some checks failed
Continuous Integration / Update Development (push) Has been cancelled
Reviewed-on: #137
This commit was merged in pull request #137.
This commit is contained in:
@@ -80,8 +80,10 @@ router.get('/me', [requireLogin], async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
let application = await getMemberApplication(userID);
|
let application = await getMemberApplication(userID);
|
||||||
|
|
||||||
if (application === undefined)
|
if (application === undefined) {
|
||||||
res.sendStatus(204);
|
res.sendStatus(204);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const comments: CommentRow[] = await getApplicationComments(application.id);
|
const comments: CommentRow[] = await getApplicationComments(application.id);
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const decisionDate = ref<Date | null>(null);
|
|||||||
const submitDate = ref<Date | null>(null);
|
const submitDate = ref<Date | null>(null);
|
||||||
const loading = ref<boolean>(true);
|
const loading = ref<boolean>(true);
|
||||||
const member_name = ref<string>();
|
const member_name = ref<string>();
|
||||||
|
const notFound = ref<boolean>(false);
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
mode?: "create" | "view-self" | "view-recruiter" | "view-self-id"
|
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) {
|
function loadData(raw: ApplicationFull) {
|
||||||
|
|
||||||
|
if (!raw) {
|
||||||
|
notFound.value = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const data = raw.application;
|
const data = raw.application;
|
||||||
|
|
||||||
appID.value = data.id;
|
appID.value = data.id;
|
||||||
@@ -129,6 +135,10 @@ async function handleDeny(id) {
|
|||||||
<div v-if="unauthorized" class="flex justify-center w-full my-10">
|
<div v-if="unauthorized" class="flex justify-center w-full my-10">
|
||||||
You do not have permission to view this application.
|
You do not have permission to view this application.
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="notFound" class="flex justify-center w-full my-10 text-muted-foreground">
|
||||||
|
Looks like you dont have an application, reach out to the administration team if you believe this is an
|
||||||
|
error.
|
||||||
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div v-if="!newApp" class="flex flex-row justify-between items-center py-2 mb-8">
|
<div v-if="!newApp" class="flex flex-row justify-between items-center py-2 mb-8">
|
||||||
<!-- Application header -->
|
<!-- Application header -->
|
||||||
@@ -181,7 +191,6 @@ async function handleDeny(id) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- TODO: Implement some kinda loading screen -->
|
|
||||||
<div v-else class="flex items-center justify-center h-full">
|
<div v-else class="flex items-center justify-center h-full">
|
||||||
<Spinner class="size-8" />
|
<Spinner class="size-8" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user