updated living space

This commit is contained in:
2025-11-27 20:22:40 +03:00
parent 3aebb79d36
commit eaca36573e
57 changed files with 2434 additions and 147 deletions

View File

@@ -0,0 +1,23 @@
'use server';
import { NextResponse } from 'next/server';
import { GraphQLClient, gql } from 'graphql-request';
const endpoint = "http://localhost:3001/graphql";
export async function GET(request: Request) {
const searchParams = new URL(request.url).searchParams;
const uuid = searchParams.get('uuid');
console.dir({ uuid }, { depth: null });
if (!uuid) { return NextResponse.json({ error: 'UUID not found in search params' }, { status: 400 }) }
try {
const client = new GraphQLClient(endpoint);
const query = gql`mutation DeleteCompany($uuid: String!) { deleteCompany(uuid: $uuid) }`;
const data = await client.request(query, { uuid });
return NextResponse.json({ data: data.deleteUserType, status: 200 });
} catch (err: any) {
console.error(err);
return NextResponse.json({ error: err.message }, { status: 500 });
}
}