Give the job tracker stores and fix the admin route guard
createCrudStore captures the places store's pattern and now backs places, job applications and job references. JobApplications.vue no longer calls gql() itself and is split into the applications table, the references table and the add form, with the status vocabulary in jobStatus.js. api.js is a thin REST client that turns failures into an ApiError carrying the backend's message; the admin views and Listening.vue use it in place of raw axios and fetch. The router guard waited on the home query's loaded flag, which is never set when that query fails, so /admin and /cv/jobs could hang. It now awaits a standalone me query owned by the auth store, and homeData gains a settled flag for widgets that only need to know the fetch finished. The Vite proxy targets are configurable through VITE_PROXY_*, and build:js runs the Vite build without wasm-pack. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
* onMounted, which is the desired "refresh on tab change" behaviour.
|
||||
*/
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
import axios from "axios";
|
||||
import { api } from "@/api";
|
||||
import Button from "@/components/input/Button.vue";
|
||||
|
||||
const lines = ref([]);
|
||||
@@ -20,11 +20,13 @@ const loadingLogs = ref(false);
|
||||
async function fetchLogs() {
|
||||
loadingLogs.value = true;
|
||||
try {
|
||||
const res = await axios.get("/api/admin/logs");
|
||||
lines.value = res.data.lines;
|
||||
const res = await api.get("/admin/logs", {
|
||||
fallback: "Failed to load logs",
|
||||
});
|
||||
lines.value = res.lines;
|
||||
logsError.value = "";
|
||||
} catch (err) {
|
||||
logsError.value = err.response?.data?.error || "Failed to load logs";
|
||||
logsError.value = err.message;
|
||||
} finally {
|
||||
loadingLogs.value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user