ligth theme design fix
This commit is contained in:
17
src/app/api/dashboard/activity-metrics/route.ts
Normal file
17
src/app/api/dashboard/activity-metrics/route.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type {NextRequest} from 'next/server';
|
||||
import {ok, parseQuery, requireApiSession, simulate, wantsEmpty} from '@/shared/services/apiRoute';
|
||||
import {buildActivityMetrics} from '@/features/dashboard/mock/intelligence.mock';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
const denied = await requireApiSession();
|
||||
if (denied) return denied;
|
||||
const q = parseQuery(req);
|
||||
const simulated = await simulate(q);
|
||||
if (simulated) return simulated;
|
||||
return ok(
|
||||
wantsEmpty(q) ? [] : buildActivityMetrics(q.range, q.storeId, q.nowMs),
|
||||
q,
|
||||
);
|
||||
}
|
||||
14
src/app/api/dashboard/campaigns/route.ts
Normal file
14
src/app/api/dashboard/campaigns/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type {NextRequest} from 'next/server';
|
||||
import {ok, parseQuery, requireApiSession, simulate, wantsEmpty} from '@/shared/services/apiRoute';
|
||||
import {buildCampaigns} from '@/features/dashboard/mock/intelligence.mock';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
const denied = await requireApiSession();
|
||||
if (denied) return denied;
|
||||
const q = parseQuery(req);
|
||||
const simulated = await simulate(q);
|
||||
if (simulated) return simulated;
|
||||
return ok(wantsEmpty(q) ? [] : buildCampaigns(q.range, q.storeId, q.nowMs), q);
|
||||
}
|
||||
20
src/app/api/dashboard/insights/route.ts
Normal file
20
src/app/api/dashboard/insights/route.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type {NextRequest} from 'next/server';
|
||||
import {ok, parseQuery, requireApiSession, simulate, wantsEmpty} from '@/shared/services/apiRoute';
|
||||
import {buildInsights} from '@/features/dashboard/mock/intelligence.mock';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
/**
|
||||
* Separate from /briefing on purpose. The briefing is Loyaly AI's narrative
|
||||
* for the panel; these are store-intelligence findings computed from the
|
||||
* activity layer, and the dashboard must be able to render one without
|
||||
* pulling in the other.
|
||||
*/
|
||||
export async function GET(req: NextRequest) {
|
||||
const denied = await requireApiSession();
|
||||
if (denied) return denied;
|
||||
const q = parseQuery(req);
|
||||
const simulated = await simulate(q);
|
||||
if (simulated) return simulated;
|
||||
return ok(wantsEmpty(q) ? [] : buildInsights(q.range, q.storeId, q.nowMs), q);
|
||||
}
|
||||
14
src/app/api/dashboard/journey/route.ts
Normal file
14
src/app/api/dashboard/journey/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type {NextRequest} from 'next/server';
|
||||
import {ok, parseQuery, requireApiSession, simulate, wantsEmpty} from '@/shared/services/apiRoute';
|
||||
import {buildJourney} from '@/features/dashboard/mock/intelligence.mock';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
const denied = await requireApiSession();
|
||||
if (denied) return denied;
|
||||
const q = parseQuery(req);
|
||||
const simulated = await simulate(q);
|
||||
if (simulated) return simulated;
|
||||
return ok(wantsEmpty(q) ? [] : buildJourney(q.range, q.storeId, q.nowMs), q);
|
||||
}
|
||||
Reference in New Issue
Block a user