fix:dashboard bearer
This commit is contained in:
parent
e235b86c12
commit
2889a9acc2
|
|
@ -1,5 +1,8 @@
|
||||||
import { PaginationRequest } from "@/types/globals";
|
import { PaginationRequest } from "@/types/globals";
|
||||||
import { httpGet, httpPost, httpPut } from "./http-config/axios-base-service";
|
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) {
|
export async function saveActivity(data: any, token?: string) {
|
||||||
const headers = token
|
const headers = token
|
||||||
|
|
@ -22,7 +25,10 @@ export async function getActivity() {
|
||||||
|
|
||||||
export async function getVisitorLog(data: any) {
|
export async function getVisitorLog(data: any) {
|
||||||
const { page, limit, startDate, endDate } = data;
|
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=${
|
const pathUrl = `/activity-logs?purpose=visitor-summary&page=${
|
||||||
page || 0
|
page || 0
|
||||||
}&limit=${limit || 10}&startDate=${startDate || ""}&endDate=${endDate || ""}`;
|
}&limit=${limit || 10}&startDate=${startDate || ""}&endDate=${endDate || ""}`;
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ export async function getUserLevelDataStat(
|
||||||
export async function getStatisticForMaps(startDate: string, endDate: string) {
|
export async function getStatisticForMaps(startDate: string, endDate: string) {
|
||||||
const headers = {
|
const headers = {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
// Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
};
|
};
|
||||||
return await httpGet(
|
return await httpGet(
|
||||||
`/activity-logs/visitors-by-region-stats?startDate=${startDate}&endDate=${endDate}`,
|
`/activity-logs/visitors-by-region-stats?startDate=${startDate}&endDate=${endDate}`,
|
||||||
|
|
@ -234,7 +234,7 @@ export async function getStatisticVisitorsBrowser(
|
||||||
) {
|
) {
|
||||||
const headers = {
|
const headers = {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
// Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
};
|
};
|
||||||
return await httpGet(
|
return await httpGet(
|
||||||
`/activity-logs/visitors-by-browser-stats?startDate=${startDate}&endDate=${endDate}`,
|
`/activity-logs/visitors-by-browser-stats?startDate=${startDate}&endDate=${endDate}`,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue