add test endpoint

This commit is contained in:
Matthias Nannt
2024-04-24 19:42:42 +02:00
parent 560b8904f7
commit d722e9de9e
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
import { NextRequest } from "next/server";
import { getEnvironment } from "@formbricks/lib/environment/service";
export async function GET(
_: NextRequest,
{ params }: { params: { environmentId: string } }
): Promise<Response> {
const environmentId = params.environmentId;
const environment = await getEnvironment(environmentId);
return Response.json(environment);
}

View File

@@ -30,6 +30,8 @@ export const getEnvironment = async (environmentId: string): Promise<TEnvironmen
async () => {
validateInputs([environmentId, ZId]);
console.log("CALLING WITHOUT CACHE!!!");
try {
const environment = await prisma.environment.findUnique({
where: {