first commit
This commit is contained in:
6
services/api/auth.api.ts
Normal file
6
services/api/auth.api.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import callAPI from "../caller/config";
|
||||
|
||||
export async function loginUser(data: any) {
|
||||
return await callAPI.post("/auth/login", data).then((res) => res.data);
|
||||
}
|
||||
|
||||
5
services/api/department.api.ts
Normal file
5
services/api/department.api.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import callAPI from "../caller/config";
|
||||
|
||||
export async function getDepartments() {
|
||||
return await callAPI.get("/department/all").then((res) => res.data);
|
||||
}
|
||||
53
services/api/report.api.ts
Normal file
53
services/api/report.api.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import callAPI from "../caller/config";
|
||||
|
||||
export async function getStatsReport() {
|
||||
return await callAPI.get("/report/stats").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getDepartmentReport() {
|
||||
return await callAPI.get("/report/departments").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getAgentPerformance() {
|
||||
return await callAPI.get("/report/agents").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getAvgResolutionTime() {
|
||||
return await callAPI.get("/report/avg-resolution").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getCriticalTickets() {
|
||||
return await callAPI.get("/report/critical").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getTicketsTrend(params: any) {
|
||||
return await callAPI.get("/report/trend", { params }).then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getClosureRate() {
|
||||
return await callAPI.get("/report/closure-rate").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getSlaBreach() {
|
||||
return await callAPI.get("/report/sla").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getAgingReport() {
|
||||
return await callAPI.get("/report/aging").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getAgentEfficiency() {
|
||||
return await callAPI.get("/report/agent-efficiency").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getDepartmentLoad() {
|
||||
return await callAPI.get("/report/department-load").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getKpiReport() {
|
||||
return await callAPI.get("/report/kpi").then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getPredictionReport() {
|
||||
return await callAPI.get("/report/prediction").then((res) => res.data);
|
||||
}
|
||||
17
services/api/ticket.api.ts
Normal file
17
services/api/ticket.api.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import callAPI from "../caller/config";
|
||||
|
||||
export async function createTicket(data: any) {
|
||||
return await callAPI.post("/ticket/create", data).then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getAllTickets(params: any) {
|
||||
return await callAPI.get("/ticket/all", { params }).then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function removeTicket(id: string) {
|
||||
return await callAPI.delete(`/ticket/remove/${id}`).then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getAllTicketsExport(params: any) {
|
||||
return await callAPI.get("/ticket/all/export", { params }).then((res) => res.data);
|
||||
}
|
||||
5
services/api/users.api.ts
Normal file
5
services/api/users.api.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import callAPI from "../caller/config";
|
||||
|
||||
export async function getUsers() {
|
||||
return await callAPI.get("/user/all").then((res) => res.data);
|
||||
}
|
||||
Reference in New Issue
Block a user