fixed infinite loading on new application

This commit is contained in:
2025-10-20 10:07:59 -04:00
parent 6d4a29e0c3
commit a67a66db1b

View File

@@ -21,16 +21,16 @@ onMounted(async () => {
try {
//get app ID from URL param
const router = useRoute();
const appIDRaw = router.params.id.toString();
const raw = await loadApplication(appIDRaw);
console.log(raw);
if (raw === null) {
const appIDRaw = router.params.id;
if (appIDRaw === undefined) {
//new app
appData.value = null
readOnly.value = false;
newApp.value = true;
} else {
//load app
const raw = await loadApplication(appIDRaw.toString());
const data = raw.application;
appID.value = data.id;
@@ -102,10 +102,10 @@ async function handleDeny(id) {
minute: "2-digit"
}) }}</p>
<div class="mt-2" v-else>
<Button variant="success" class="mr-2" :onclick="() => {handleApprove(appID)}">
<Button variant="success" class="mr-2" :onclick="() => { handleApprove(appID) }">
<CheckIcon></CheckIcon>
</Button>
<Button variant="destructive" :onClick="() => {handleDeny(appID)}">
<Button variant="destructive" :onClick="() => { handleDeny(appID) }">
<XIcon></XIcon>
</Button>
</div>