File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
apps/website/app/api/access-token Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export const POST = async (request: Request) => {
3232
3333 // const { data, error } = await query;
3434
35- const data = [ { "access-token" : "dummy data" } ] ;
35+ const data = { "access-token" : "dummy data" } ;
3636 const error = null ;
3737
3838 if ( error ) {
@@ -42,14 +42,14 @@ export const POST = async (request: Request) => {
4242 ) ;
4343 }
4444
45- if ( ! data || data . length === 0 ) {
45+ if ( ! data ) {
4646 return NextResponse . json (
4747 { error : "No access token found" } ,
4848 { status : 404 } ,
4949 ) ;
5050 }
5151
52- return NextResponse . json ( { accessToken : data [ 0 ] [ "access-token" ] } ) ;
52+ return NextResponse . json ( { accessToken : data [ "access-token" ] } ) ;
5353 } catch ( error ) {
5454 if ( error instanceof z . ZodError ) {
5555 return NextResponse . json (
You can’t perform that action at this time.
0 commit comments