(plan) convert original implement plan to mock api
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { DEFAULT_KINDS, resourceKinds } from '@/lib/clusterMock'
|
||||
|
||||
/** Mock stand-in for the real atlas `GET /api/delivery/{app}/resources`. No real pagination — fixture is small. */
|
||||
export async function GET(_req: Request, { params }: { params: Promise<{ app: string }> }) {
|
||||
const { app } = await params
|
||||
const kinds = resourceKinds[app] ?? DEFAULT_KINDS
|
||||
return NextResponse.json({
|
||||
data: { app, kinds },
|
||||
meta: { cursor: null, hasMore: false },
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { apps, cluster, WAVES } from '@/lib/clusterMock'
|
||||
|
||||
/** Mock stand-in for the real atlas `GET /api/delivery`. Serves fixture data, not a live Argo watch. */
|
||||
export async function GET() {
|
||||
return NextResponse.json({
|
||||
data: { apps, waves: WAVES },
|
||||
meta: { snapshotAge: cluster.snapshotAge, generation: cluster.generation, truncated: false },
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user