updated build-sites

This commit is contained in:
2025-11-19 19:56:50 +03:00
parent 688576a1de
commit 44f209ae1f
95 changed files with 2635 additions and 116 deletions

View File

@@ -0,0 +1,33 @@
'use server';
import { NextResponse } from 'next/server';
import { GraphQLClient, gql } from 'graphql-request';
const endpoint = "http://localhost:3001/graphql";
export async function POST(request: Request) {
const body = await request.json();
const { limit, skip, sort, filters } = body;
try {
const client = new GraphQLClient(endpoint);
const query = gql`
query BuildIbans($input: ListArguments!) {
buildIbans(input: $input) {
data {
iban
startDate
stopDate
bankCode
xcomment
}
totalCount
}
}`;
const variables = { input: { limit, skip, sort, filters } };
console.dir({ variables })
const data = await client.request(query, variables);
return NextResponse.json({ data: data.buildIbans.data, totalCount: data.buildIbans.totalCount });
} catch (err: any) {
console.error(err);
return NextResponse.json({ error: err.message }, { status: 500 });
}
}