Skip to content

Commit e2b5ddf

Browse files
authored
feat: add export jobs update ui (#1006)
* feat: add export jobsu pdate ui * feat: comments * feat: update migrations * feat: fix linter
1 parent ada5868 commit e2b5ddf

File tree

12 files changed

+5328
-740
lines changed

12 files changed

+5328
-740
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { NextRequest, NextResponse } from "next/server";
2+
import { prettifyError, ZodError } from "zod/v4";
3+
4+
import { getExportJob } from "@/lib/actions/dataset-export-jobs";
5+
6+
export async function GET(
7+
_req: NextRequest,
8+
props: { params: Promise<{ projectId: string; datasetId: string }> }
9+
): Promise<Response> {
10+
const params = await props.params;
11+
const { projectId, datasetId } = params;
12+
13+
try {
14+
const job = await getExportJob({ projectId, datasetId });
15+
return NextResponse.json(job);
16+
} catch (error) {
17+
if (error instanceof ZodError) {
18+
return Response.json({ error: prettifyError(error) }, { status: 400 });
19+
}
20+
21+
return NextResponse.json(
22+
{ error: error instanceof Error ? error.message : "Failed to fetch export job" },
23+
{ status: 500 }
24+
);
25+
}
26+
}

frontend/app/api/projects/[projectId]/datasets/[datasetId]/parquets/route.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export async function GET(req: NextRequest, { params }: { params: Promise<{ proj
1010
return NextResponse.json(parquets);
1111
}
1212

13-
export async function POST(req: NextRequest, { params }: { params: Promise<{ projectId: string; datasetId: string }> }) {
13+
export async function POST(
14+
req: NextRequest,
15+
{ params }: { params: Promise<{ projectId: string; datasetId: string }> }
16+
) {
1417
const { projectId, datasetId } = await params;
1518

1619
const job = await startParquetExportJob(projectId, datasetId);

0 commit comments

Comments
 (0)