AEB-71: Added 3D navigation in monitoring zones
This commit is contained in:
@@ -36,10 +36,16 @@ export async function GET(req: NextRequest) {
|
||||
if (!backendUrl) {
|
||||
return NextResponse.json({ success: false, error: 'BACKEND_URL is not configured' }, { status: 500 })
|
||||
}
|
||||
|
||||
|
||||
const url = new URL(req.url)
|
||||
const timePeriod = url.searchParams.get('time_period')
|
||||
const qs = timePeriod ? `?time_period=${encodeURIComponent(timePeriod)}` : ''
|
||||
const timePeriodRaw = url.searchParams.get('time_period')
|
||||
const allowedPeriods = new Set([24, 72, 168, 720])
|
||||
let timePeriodNum = timePeriodRaw ? Number(timePeriodRaw) : undefined
|
||||
if (Number.isNaN(timePeriodNum)) {
|
||||
timePeriodNum = undefined
|
||||
}
|
||||
const finalTimePeriod = timePeriodNum && allowedPeriods.has(timePeriodNum) ? String(timePeriodNum) : '168'
|
||||
const qs = `?time_period=${encodeURIComponent(finalTimePeriod)}`
|
||||
|
||||
const res = await fetch(`${backendUrl}/account/get-dashboard/${qs}`, {
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user