Enabled restarting your application from denied state
Some checks failed
Continuous Deployment / Update Deployment (push) Failing after 1m23s
Some checks failed
Continuous Deployment / Update Deployment (push) Failing after 1m23s
This commit is contained in:
@@ -136,4 +136,15 @@ export async function denyApplication(id: Number) {
|
||||
if (!res.ok) {
|
||||
console.error("Something went wrong denying the application")
|
||||
}
|
||||
}
|
||||
|
||||
export async function restartApplication() {
|
||||
const res = await fetch(`${addr}/application/restart`, {
|
||||
method: 'POST',
|
||||
credentials: 'include'
|
||||
})
|
||||
|
||||
if (!res.ok) {
|
||||
console.error("Something went wrong restarting your application")
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import { useUserStore } from '@/stores/user';
|
||||
import { Check, Circle, Dot, Users, X } from 'lucide-vue-next'
|
||||
import { computed, ref } from 'vue';
|
||||
import Application from './Application.vue';
|
||||
import { restartApplication } from '@/api/application';
|
||||
|
||||
function goToLogin() {
|
||||
const redirectUrl = encodeURIComponent(window.location.origin + '/join')
|
||||
@@ -71,10 +72,18 @@ const currentStep = computed<number>(() => {
|
||||
})
|
||||
|
||||
const finalPanel = ref<'app' | 'message'>('message');
|
||||
|
||||
const reloadKey = ref(0);
|
||||
|
||||
async function restartApp() {
|
||||
await restartApplication();
|
||||
await userStore.loadUser();
|
||||
reloadKey.value++;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex flex-col items-center mt-10 w-full">
|
||||
<div class="flex flex-col items-center mt-10 w-full" :key="reloadKey">
|
||||
|
||||
<!-- Stepper Container -->
|
||||
<div class="w-full flex justify-center">
|
||||
@@ -219,8 +228,8 @@ const finalPanel = ref<'app' | 'message'>('message');
|
||||
</div>
|
||||
<!-- Denied message -->
|
||||
<div v-else-if="userStore.state === 'denied'">
|
||||
<div class="w-full max-w-2xl p-8">
|
||||
<h1 class="text-3xl sm:text-4xl font-bold mb-4 text-left text-destructive">
|
||||
<div class="w-full max-w-2xl flex flex-col gap-8">
|
||||
<h1 class="text-3xl sm:text-4xl font-bold text-left">
|
||||
Application Not Approved
|
||||
</h1>
|
||||
<div class="space-y-4 text-muted-foreground text-left leading-relaxed">
|
||||
@@ -246,6 +255,7 @@ const finalPanel = ref<'app' | 'message'>('message');
|
||||
Team</span>
|
||||
</p>
|
||||
</div>
|
||||
<Button class="w-min" @click="restartApp">Restart Application</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user