implemented some recruiter view features
This commit is contained in:
@@ -50,7 +50,7 @@ export async function postApplication(val: any) {
|
||||
}
|
||||
|
||||
export async function postChatMessage(val: any) {
|
||||
|
||||
|
||||
let output = {
|
||||
message: val,
|
||||
sender: 1,
|
||||
@@ -62,4 +62,30 @@ export async function postChatMessage(val: any) {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(output),
|
||||
})
|
||||
}
|
||||
|
||||
export async function getAllApplications() {
|
||||
const res = await fetch(`http://${addr}/application/all`)
|
||||
|
||||
if (res.ok) {
|
||||
return await res.json();
|
||||
} else {
|
||||
console.error("Something went wrong approving the application")
|
||||
}
|
||||
}
|
||||
|
||||
export async function approveApplication(id: Number) {
|
||||
const res = await fetch(`http://${addr}/application/approve/${id}`, { method: 'POST' })
|
||||
|
||||
if (!res.ok) {
|
||||
console.error("Something went wrong approving the application")
|
||||
}
|
||||
}
|
||||
|
||||
export async function denyApplication(id: Number) {
|
||||
const res = await fetch(`http://${addr}/application/deny/${id}`, { method: 'POST' })
|
||||
|
||||
if (!res.ok) {
|
||||
console.error("Something went wrong approving the application")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user