Skip to content

Commit aa7fec9

Browse files
committed
fix: map
1 parent e509ad6 commit aa7fec9

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

apps/api/src/query/builders/geo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { SimpleQueryConfig } from "../types";
22
import { Analytics } from "../../types/tables";
33

4-
export const GeoBuilders: Record<string, SimpleQueryConfig<typeof Analytics.events>> = {
4+
export const GeoBuilders: Record<string, SimpleQueryConfig> = {
55
country: {
66
table: Analytics.events,
77
fields: [

apps/better-admin

apps/dashboard/app/(main)/websites/[id]/map/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ function WebsiteMapPage() {
6161
});
6262

6363
const locationData: LocationData = {
64-
countries: (getDataForQuery("map-countries", "countries") || []).map((item: { name: string; visitors: number; pageviews: number; country_code?: string; country_name?: string }) => ({
64+
countries: (getDataForQuery("map-countries", "country") || []).map((item: { name: string; visitors: number; pageviews: number; country_code?: string; country_name?: string }) => ({
6565
country: item.country_name || item.name,
6666
country_code: item.country_code || item.name,
6767
visitors: item.visitors,
6868
pageviews: item.pageviews,
6969
})),
70-
regions: (getDataForQuery("map-regions", "regions") || []).map((item: { name: string; visitors: number; pageviews: number }) => ({
70+
regions: (getDataForQuery("map-regions", "region") || []).map((item: { name: string; visitors: number; pageviews: number }) => ({
7171
country: item.name,
7272
visitors: item.visitors,
7373
pageviews: item.pageviews,

apps/dashboard/hooks/use-dynamic-query.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,14 +608,14 @@ export function useMapLocationData(
608608
const queries: DynamicQueryRequest[] = [
609609
{
610610
id: "map-countries",
611-
parameters: ["countries"],
612-
limit: 100,
613-
},
614-
{
615-
id: "map-regions",
616-
parameters: ["regions"],
611+
parameters: ["country"],
617612
limit: 100,
618613
},
614+
// {
615+
// id: "map-regions",
616+
// parameters: ["region"],
617+
// limit: 100,
618+
// },
619619
];
620620

621621
return useBatchDynamicQuery(websiteId, dateRange, queries, options);

0 commit comments

Comments
 (0)