fix:dashboard bearer

This commit is contained in:
Rama Priyanto 2026-02-06 15:13:35 +07:00
parent e235b86c12
commit 2889a9acc2
2 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,8 @@
import { PaginationRequest } from "@/types/globals";
import { httpGet, httpPost, httpPut } from "./http-config/axios-base-service";
import Cookies from "js-cookie";
const token = Cookies.get("access_token");
export async function saveActivity(data: any, token?: string) {
const headers = token
@ -22,7 +25,10 @@ export async function getActivity() {
export async function getVisitorLog(data: any) {
const { page, limit, startDate, endDate } = data;
const headers = { "content-type": "application/json" };
const headers = {
"content-type": "application/json",
Authorization: `Bearer ${token}`,
};
const pathUrl = `/activity-logs?purpose=visitor-summary&page=${
page || 0
}&limit=${limit || 10}&startDate=${startDate || ""}&endDate=${endDate || ""}`;

View File

@ -220,7 +220,7 @@ export async function getUserLevelDataStat(
export async function getStatisticForMaps(startDate: string, endDate: string) {
const headers = {
"content-type": "application/json",
// Authorization: `Bearer ${token}`,
Authorization: `Bearer ${token}`,
};
return await httpGet(
`/activity-logs/visitors-by-region-stats?startDate=${startDate}&endDate=${endDate}`,
@ -234,7 +234,7 @@ export async function getStatisticVisitorsBrowser(
) {
const headers = {
"content-type": "application/json",
// Authorization: `Bearer ${token}`,
Authorization: `Bearer ${token}`,
};
return await httpGet(
`/activity-logs/visitors-by-browser-stats?startDate=${startDate}&endDate=${endDate}`,