File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/database/supabase/functions/create-group Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ Deno.serve(async (req) => {
3232 } ,
3333 } ) ;
3434 }
35+ if ( req . method !== "POST" ) {
36+ return Response . json (
37+ { msg : 'Method not allowed' } ,
38+ { status : 405 }
39+ ) ;
40+ }
3541
3642 // @ts -ignore Deno is not visible to the IDE
3743 const url = Deno . env . get ( "SUPABASE_URL" ) ;
@@ -84,7 +90,7 @@ Deno.serve(async (req) => {
8490 if ( membershipResponse . error )
8591 return Response . json ( { msg : `Failed to create membership for group ${ group_id } ` , error : membershipResponse . error . message } , { status : 500 } ) ;
8692
87- const res = new Response ( group_id ) ;
93+ const res = Response . json ( { group_id} ) ;
8894
8995 if ( originIsAllowed ) {
9096 res . headers . set ( "Access-Control-Allow-Origin" , origin as string ) ;
You can’t perform that action at this time.
0 commit comments