mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-19 19:21:15 -05:00
add test endpoint
This commit is contained in:
13
apps/web/app/api/v1/client/[environmentId]/test/route.ts
Normal file
13
apps/web/app/api/v1/client/[environmentId]/test/route.ts
Normal 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);
|
||||
}
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user