updated living space added

This commit is contained in:
2025-12-04 15:46:24 +03:00
parent 56b42bb906
commit 53e1f1e4fc
70 changed files with 1128 additions and 824 deletions

View File

@@ -8,6 +8,9 @@ const endpoint = "http://localhost:3001/graphql";
export async function POST(request: Request) {
const body = await request.json();
const validatedBody = buildIbansAddSchema.parse(body);
const url = new URL(request.url)
const buildID = url.searchParams.get('build');
if (!buildID) { return NextResponse.json({ error: 'Build ID is required' }, { status: 400 }) }
try {
const client = new GraphQLClient(endpoint);
const query = gql`
@@ -22,7 +25,7 @@ export async function POST(request: Request) {
}
}
`;
const variables = { input: validatedBody };
const variables = { input: { ...validatedBody, buildId: buildID } };
const data = await client.request(query, variables);
return NextResponse.json({ data: data.createBuildIban, status: 200 });
} catch (err: any) {