feat: bootstrap auto virtual tryon admin frontend

This commit is contained in:
afei A
2026-03-27 23:38:50 +08:00
commit 98c6b741d6
119 changed files with 19046 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import { adaptWorkflowDetail } from "@/lib/adapters/workflows";
import { backendRequest } from "@/lib/http/backend-client";
import {
jsonSuccess,
parsePositiveIntegerParam,
withErrorHandling,
} from "@/lib/http/response";
import type { WorkflowStatusResponseDto } from "@/lib/types/backend";
type RouteContext = {
params: Promise<{
orderId: string;
}>;
};
export async function GET(_request: Request, context: RouteContext) {
return withErrorHandling(async () => {
const { orderId: rawOrderId } = await context.params;
const orderId = parsePositiveIntegerParam(rawOrderId, "orderId");
const response = await backendRequest<WorkflowStatusResponseDto>(
`/workflows/${orderId}`,
);
return jsonSuccess(adaptWorkflowDetail(response.data), {
mode: "proxy",
});
});
}