31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import { PaginationRequest } from "@/types/globals";
|
|
import { httpGet, httpPost, httpPut } from "./http-config/axios-base-service";
|
|
|
|
export async function saveActivity(data: any, token?: string) {
|
|
const headers = token
|
|
? {
|
|
"content-type": "application/json",
|
|
Authorization: `Bearer ${token}`,
|
|
}
|
|
: {
|
|
"content-type": "application/json",
|
|
};
|
|
const pathUrl = `/activity-logs`;
|
|
return await httpPost(pathUrl, headers, data);
|
|
}
|
|
|
|
export async function getActivity() {
|
|
const headers = { "content-type": "application/json" };
|
|
const pathUrl = `/activity-logs/statistics`;
|
|
return await httpGet(pathUrl, headers);
|
|
}
|
|
|
|
export async function getVisitorLog(data: any) {
|
|
const { page, limit, startDate, endDate } = data;
|
|
const headers = { "content-type": "application/json" };
|
|
const pathUrl = `/activity-logs?purpose=visitor-summary&page=${
|
|
page || 0
|
|
}&limit=${limit || 10}&startDate=${startDate || ""}&endDate=${endDate || ""}`;
|
|
return await httpGet(pathUrl, headers);
|
|
}
|