From f0ac2dca027d2016d7ec60da30bb62a20566419b Mon Sep 17 00:00:00 2001 From: ajdj100 Date: Thu, 11 Dec 2025 20:37:00 -0500 Subject: [PATCH] fixed an issue with a bad response on submitting LOA --- ui/src/api/loa.ts | 5 ++--- ui/src/components/loa/loaForm.vue | 3 +++ ui/src/pages/ManageLOA.vue | 34 ++++++++++++++++--------------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/ui/src/api/loa.ts b/ui/src/api/loa.ts index f8ba82b..dd7350a 100644 --- a/ui/src/api/loa.ts +++ b/ui/src/api/loa.ts @@ -13,9 +13,9 @@ export async function submitLOA(request: LOARequest): Promise<{ id?: number; err }); if (res.ok) { - return res.json(); + return; } else { - return { error: "Failed to submit LOA" }; + throw new Error("Failed to submit LOA"); } } @@ -113,7 +113,6 @@ export async function getLoaPolicy(): Promise { }); if (res.ok) { const out = res.json(); - console.log(out); if (!out) { return null; } diff --git a/ui/src/components/loa/loaForm.vue b/ui/src/components/loa/loaForm.vue index df4ddb0..3ca59a1 100644 --- a/ui/src/components/loa/loaForm.vue +++ b/ui/src/components/loa/loaForm.vue @@ -58,11 +58,13 @@ const df = new Intl.DateTimeFormat('en-US', { day: 'numeric' }); +const userStore = useUserStore() //form stuff import { loaSchema } from '@shared/schemas/loaSchema' import { toTypedSchema } from "@vee-validate/zod"; import Calendar from "../ui/calendar/Calendar.vue"; +import { useUserStore } from "@/stores/user"; const { handleSubmit, values, resetForm } = useForm({ validationSchema: toTypedSchema(loaSchema), @@ -81,6 +83,7 @@ const onSubmit = handleSubmit(async (values) => { await adminSubmitLOA(out); } else { await submitLOA(out); + userStore.loadUser(); } }) diff --git a/ui/src/pages/ManageLOA.vue b/ui/src/pages/ManageLOA.vue index 3d706b8..1d9298f 100644 --- a/ui/src/pages/ManageLOA.vue +++ b/ui/src/pages/ManageLOA.vue @@ -17,22 +17,24 @@ const showLOADialog = ref(false); \ No newline at end of file