fixed infinite loading on new application
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user