web-humas-fe/service/feedbacks.ts

36 lines
843 B
TypeScript

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",
};
const pathUrl = `/feedbacks?limit=${data?.limit || ""}&message=${
data?.search || ""
}`;
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);
}