finalized application acceptance system and started making types shared across front and backend
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import ApplicationChat from '@/components/application/ApplicationChat.vue';
|
||||
import ApplicationForm from '@/components/application/ApplicationForm.vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { ApplicationData, approveApplication, denyApplication, loadApplication, postApplication, postChatMessage, Status } from '@/api/application';
|
||||
import { ApplicationData, approveApplication, denyApplication, loadApplication, postApplication, postChatMessage, ApplicationStatus } from '@/api/application';
|
||||
import { useRoute } from 'vue-router';
|
||||
import Button from '@/components/ui/button/Button.vue';
|
||||
import { CheckIcon, XIcon } from 'lucide-vue-next';
|
||||
@@ -12,7 +12,7 @@ const appID = ref<number | null>(null);
|
||||
const chatData = ref<object[]>([])
|
||||
const readOnly = ref<boolean>(false);
|
||||
const newApp = ref<boolean>(null);
|
||||
const status = ref<Status>(null);
|
||||
const status = ref<ApplicationStatus>(null);
|
||||
const decisionDate = ref<Date | null>(null);
|
||||
const submitDate = ref<Date | null>(null);
|
||||
const loading = ref<boolean>(true);
|
||||
@@ -54,6 +54,7 @@ async function postComment(comment) {
|
||||
}
|
||||
|
||||
async function postApp(appData) {
|
||||
console.log("test")
|
||||
const res = await postApplication(appData);
|
||||
if (res.ok) {
|
||||
readOnly.value = true;
|
||||
@@ -89,11 +90,11 @@ async function handleDeny(id) {
|
||||
<div>
|
||||
<h3 class="text-right" :class="[
|
||||
'font-semibold',
|
||||
status === Status.Pending && 'text-yellow-500',
|
||||
status === Status.Accepted && 'text-green-500',
|
||||
status === Status.Denied && 'text-red-500'
|
||||
status === ApplicationStatus.Pending && 'text-yellow-500',
|
||||
status === ApplicationStatus.Accepted && 'text-green-500',
|
||||
status === ApplicationStatus.Denied && 'text-red-500'
|
||||
]">{{ status }}</h3>
|
||||
<p v-if="status != Status.Pending" class="text-muted-foreground">{{ status }}: {{
|
||||
<p v-if="status != ApplicationStatus.Pending" class="text-muted-foreground">{{ status }}: {{
|
||||
decisionDate.toLocaleString("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
|
||||
Reference in New Issue
Block a user