Supported public vs internal application comments, and moved some type dependencies to the shared lib
This commit is contained in:
@@ -2,15 +2,16 @@
|
||||
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, ApplicationStatus, getMyApplication, ApplicationFull } from '@/api/application';
|
||||
import { approveApplication, denyApplication, loadApplication, postApplication, postChatMessage, getMyApplication, postAdminChatMessage } from '@/api/application';
|
||||
import { useRoute } from 'vue-router';
|
||||
import Button from '@/components/ui/button/Button.vue';
|
||||
import { CheckIcon, XIcon } from 'lucide-vue-next';
|
||||
import Unauthorized from './Unauthorized.vue';
|
||||
import { ApplicationData, ApplicationFull, ApplicationStatus, CommentRow } from '@shared/types/application';
|
||||
|
||||
const appData = ref<ApplicationData>(null);
|
||||
const appID = ref<number | null>(null);
|
||||
const chatData = ref<object[]>([])
|
||||
const chatData = ref<CommentRow[]>([])
|
||||
const readOnly = ref<boolean>(false);
|
||||
const newApp = ref<boolean>(null);
|
||||
const status = ref<ApplicationStatus>(null);
|
||||
@@ -47,7 +48,7 @@ onMounted(async () => {
|
||||
//recruiter mode
|
||||
if (props.mode === 'view-recruiter') {
|
||||
finalMode.value = 'view-recruiter';
|
||||
loadData(await loadApplication(Number(route.params.id)))
|
||||
loadData(await loadApplication(Number(route.params.id), true))
|
||||
}
|
||||
|
||||
//viewer mode
|
||||
@@ -87,6 +88,10 @@ async function postComment(comment) {
|
||||
chatData.value.push(await postChatMessage(comment, appID.value));
|
||||
}
|
||||
|
||||
async function postCommentInternal(comment) {
|
||||
chatData.value.push(await postAdminChatMessage(comment, appID.value));
|
||||
}
|
||||
|
||||
const emit = defineEmits(['submit']);
|
||||
|
||||
async function postApp(appData) {
|
||||
@@ -159,7 +164,8 @@ async function handleDeny(id) {
|
||||
</ApplicationForm>
|
||||
<div v-if="!newApp" class="pb-15">
|
||||
<h3 class="scroll-m-20 text-2xl font-semibold tracking-tight mb-4">Discussion</h3>
|
||||
<ApplicationChat :messages="chatData" @post="postComment"></ApplicationChat>
|
||||
<ApplicationChat :messages="chatData" @post="postComment" @post-internal="postCommentInternal">
|
||||
</ApplicationChat>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { getAllApplications, approveApplication, denyApplication, ApplicationStatus } from '@/api/application';
|
||||
import { getAllApplications, approveApplication, denyApplication } from '@/api/application';
|
||||
import { ApplicationStatus } from '@shared/types/application'
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { getAllApplications, approveApplication, denyApplication, ApplicationStatus, loadMyApplications } from '@/api/application';
|
||||
import { loadMyApplications } from '@/api/application';
|
||||
import { ApplicationStatus } from '@shared/types/application';
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
|
||||
Reference in New Issue
Block a user