import { NextApiRequest , NextApiResponse } from 'next' ; import supabaseClient from 'utils/supabase' ; export default async function pasteId ( req , res ) { const { data : pastes , error } = await supabaseClient . from ( 'Pastes' ) . select ( '*' ) . eq ( 'pasteId' , req . query . paste ) ; if ( error || ! pastes ) { return res . status ( 400 ) . json ( { error } ) ; } res . json ( { paste : pastes [ 0 ] } ) ; }