web-humas-fe/service/feedbacks.ts

39 lines
977 B
TypeScript
Raw Normal View History

2025-03-06 10:40:54 +00:00
import {
httpDeleteInterceptor,
httpGet,
httpPost,
httpPut,
} from "./http-config/axios-base-service";
import Cookies from "js-cookie";
const token = Cookies.get("access_token");
export async function createFeedback(data: any) {
const headers = {
"content-type": "application/json",
};
const pathUrl = `/feedbacks`;
return await httpPost(pathUrl, headers, data);
}
export async function getFeedbacks(data: any) {
const headers = {
"content-type": "application/json",
};
2025-03-06 14:58:38 +00:00
const pathUrl = `/feedbacks?page=${data?.page || 1}limit=${
data?.limit || ""
}&message=${data?.search || ""}`;
2025-03-06 10:40:54 +00:00
return await httpGet(pathUrl, headers);
}
export async function getFeedbacksById(id: number) {
const headers = {
"content-type": "application/json",
};
const pathUrl = `/feedbacks/${id}`;
return await httpGet(pathUrl, headers);
}
2025-03-06 14:58:38 +00:00
export async function deleteFeedback(id: number) {
return await httpDeleteInterceptor(`/feedbacks/${id}`);
}