Add Jobs link to CV and fix auth race on job applications page
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 19s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 11:03:00 +01:00
parent 0dc1c278c2
commit fc9d3c97bf
2 changed files with 22 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
<script setup>
import { ref, shallowRef, defineAsyncComponent } from "vue";
import { RouterLink } from "vue-router";
import CVGeneral from "./CVGeneral.vue";
import CVBackend from "./CVBackend.vue";
import CVFrontend from "./CVFrontend.vue";
@@ -34,6 +35,7 @@ function print() {
{{ t.label }}
</button>
<button class="cv-btn cv-print-btn" @click="print()">Print</button>
<RouterLink to="/cv/jobs" class="cv-btn cv-jobs-btn">Jobs</RouterLink>
</div>
<Transition name="cv-fade" mode="out-in">
<component :is="currentComponent" :key="selected" />
@@ -85,6 +87,11 @@ function print() {
margin-left: 1rem;
}
.cv-jobs-btn {
text-decoration: none;
margin-left: auto;
}
.cv-fade-enter-active,
.cv-fade-leave-active {
transition:

View File

@@ -1,10 +1,12 @@
<script setup>
import { ref, onMounted } from "vue";
import { ref, watch } from "vue";
import { useRouter, RouterLink } from "vue-router";
import { useAuthStore } from "@/stores/auth";
import { useHomeDataStore } from "@/stores/homeData";
import { gql } from "@/graphql";
const auth = useAuthStore();
const homeData = useHomeDataStore();
const router = useRouter();
const applications = ref([]);
@@ -148,13 +150,18 @@ function statusClass(status) {
return map[status] ?? "";
}
onMounted(() => {
watch(
() => homeData.loaded,
(loaded) => {
if (!loaded) return;
if (!auth.user.admin) {
router.push("/admin");
} else {
fetchApplications();
}
});
},
{ immediate: true },
);
</script>
<template>