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
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:
@@ -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:
|
||||
|
||||
@@ -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(() => {
|
||||
if (!auth.user.admin) {
|
||||
router.push("/admin");
|
||||
} else {
|
||||
fetchApplications();
|
||||
}
|
||||
});
|
||||
watch(
|
||||
() => homeData.loaded,
|
||||
(loaded) => {
|
||||
if (!loaded) return;
|
||||
if (!auth.user.admin) {
|
||||
router.push("/admin");
|
||||
} else {
|
||||
fetchApplications();
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user