@@ -2,8 +2,7 @@ import type { User } from "lucia";
22import type { NextRequest } from "next/server" ;
33
44import { headers } from "next/headers" ;
5- import { queryByTestId } from "@testing-library/react" ;
6- import { createNextHandler , RequestValidationError , TsRestRequest } from "@ts-rest/serverless/next" ;
5+ import { createNextHandler , TsRestRequest } from "@ts-rest/serverless/next" ;
76import { jsonObjectFrom } from "kysely/helpers/postgres" ;
87import qs from "qs" ;
98import { z } from "zod" ;
@@ -22,7 +21,7 @@ import type {
2221 ApiAccessPermissionConstraintsInput ,
2322 LastModifiedBy ,
2423} from "db/types" ;
25- import { filterSchema , siteApi , TOTAL_PUBS_COUNT_HEADER } from "contracts" ;
24+ import { siteApi , TOTAL_PUBS_COUNT_HEADER } from "contracts" ;
2625import { ApiAccessScope , ApiAccessType , Capabilities , MembershipType } from "db/public" ;
2726
2827import type { CapabilityTarget } from "~/lib/authorization/capabilities" ;
@@ -52,7 +51,6 @@ import {
5251import { validateApiAccessToken } from "~/lib/server/apiAccessTokens" ;
5352import { getCommunitySlug } from "~/lib/server/cache/getCommunitySlug" ;
5453import { findCommunityBySlug } from "~/lib/server/community" ;
55- import { getForm } from "~/lib/server/form" ;
5654import { validateFilter } from "~/lib/server/pub-filters-validate" ;
5755import { getPubType , getPubTypesForCommunity } from "~/lib/server/pubtype" ;
5856import { getStages } from "~/lib/server/stages" ;
@@ -273,27 +271,6 @@ const parseQueryWithQsMiddleware: RequestMiddleware = (req) => {
273271const handler = createNextHandler (
274272 siteApi ,
275273 {
276- forms : {
277- get : async ( { params } ) => {
278- const { user, community } = await checkAuthorization ( {
279- token : { scope : ApiAccessScope . community , type : ApiAccessType . read } ,
280- cookies : true ,
281- } ) ;
282-
283- const form = await getForm ( {
284- id : params . formId ,
285- communityId : community . id ,
286- } ) . executeTakeFirst ( ) ;
287-
288- if ( ! form ) {
289- return { status : 404 , body : "Form not found" } ;
290- }
291- return {
292- status : 200 ,
293- body : form ,
294- } ;
295- } ,
296- } ,
297274 pubs : {
298275 search : async ( { query } ) => {
299276 const { user, community } = await checkAuthorization ( {
0 commit comments