File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 11import { NextResponse } from "next/server" ;
22import { decode } from "../../../../lib/encoder" ;
33
4- export const runtime = ' edge' ;
4+ export const runtime = " edge" ;
55export async function POST ( request : Request ) {
66 try {
77 const reqjson = await request . json ( ) ;
@@ -15,6 +15,13 @@ export async function POST(request: Request) {
1515 ) ;
1616 }
1717
18+ if ( ! game ) {
19+ return NextResponse . json (
20+ { error : "The body game is required." } ,
21+ { status : 400 }
22+ ) ;
23+ }
24+
1825 const encodedText = decode ( text , game ) ;
1926
2027 return new NextResponse ( encodedText , {
Original file line number Diff line number Diff line change 11import { NextResponse } from "next/server" ;
22import { encode } from "../../../../lib/encoder" ;
33
4- export const runtime = ' edge' ;
4+ export const runtime = " edge" ;
55export async function POST ( request : Request ) {
66 try {
77 const reqjson = await request . json ( ) ;
@@ -15,6 +15,13 @@ export async function POST(request: Request) {
1515 ) ;
1616 }
1717
18+ if ( ! game ) {
19+ return NextResponse . json (
20+ { error : "The body game is required." } ,
21+ { status : 400 }
22+ ) ;
23+ }
24+
1825 const encodedText = encode ( text , game ) ;
1926
2027 return new NextResponse ( encodedText , {
You can’t perform that action at this time.
0 commit comments