feat: implement AI city forecasting and market scan hooks with backend API integration for the scan terminal dashboard
This commit is contained in:
@@ -34,7 +34,7 @@ import type {
|
||||
} from "@/lib/dashboard-types";
|
||||
import {
|
||||
buildBrowserBackendHeaders,
|
||||
resolveBackendApiUrl,
|
||||
fetchBackendApi,
|
||||
} from "@/lib/backend-api";
|
||||
import { getLocalizedCityName } from "@/lib/dashboard-home-copy";
|
||||
import { AiPinnedForecastView } from "@/components/dashboard/scan-terminal/AiPinnedForecastView";
|
||||
@@ -249,7 +249,7 @@ function ScanTerminalScreen() {
|
||||
})
|
||||
.then((headers) => {
|
||||
if (cancelled) return null;
|
||||
return fetch(resolveBackendApiUrl(`/api/scan/terminal?${params.toString()}`), {
|
||||
return fetchBackendApi(`/api/scan/terminal?${params.toString()}`, {
|
||||
cache: "no-store",
|
||||
headers,
|
||||
signal: controller.signal,
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
import { useDashboardStore } from "@/hooks/useDashboardStore";
|
||||
import {
|
||||
buildBrowserBackendHeaders,
|
||||
resolveBackendApiUrl,
|
||||
fetchBackendApi,
|
||||
} from "@/lib/backend-api";
|
||||
import type { CityDetail, MarketScan } from "@/lib/dashboard-types";
|
||||
import { normalizeCityKey } from "./decision-utils";
|
||||
@@ -192,7 +192,7 @@ export function useAiCityForecast({
|
||||
})
|
||||
.then((headers) => {
|
||||
if (cancelled) return null;
|
||||
return fetch(resolveBackendApiUrl("/api/scan/terminal/ai-city"), {
|
||||
return fetchBackendApi("/api/scan/terminal/ai-city", {
|
||||
method: "POST",
|
||||
headers,
|
||||
cache: "no-store",
|
||||
|
||||
Reference in New Issue
Block a user