web-humas-fe/services/activity-log.ts

31 lines
1.0 KiB
TypeScript
Raw Permalink Normal View History

2025-02-07 09:37:39 +00:00
import { PaginationRequest } from "@/types/globals";
2025-03-18 08:30:18 +00:00
import { httpGet, httpPost, httpPut } from "./http-config/axios-base-service";
2025-02-07 09:37:39 +00:00
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);
}
2025-04-21 06:21:05 +00:00
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);
}