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