Mojo Edits
Mojo Edits
DTDrizzle Team
Created by Mojo Edits on 12/23/2023 in #help
trying to retrieve data
trying to retrieve data of table which contain ref id of another table working perfect on my localhost but when i try to get the same data after push the code to domain it shows empty even data is available in db table should i need to define anything else to get the data here is my api endpoint export const GET = async (request: NextRequest) => { const token = request.cookies.get('session')?.value as any console.log(token, 'Token'); const res = await db .select() .from(productsTable) .where(and(eq(productsTable.session, token))) .orderBy(desc(productsTable.id)).execute(); // .limit(1) return NextResponse.json(res, { status: 200 }) }
57 replies