import { getSession , withApiAuthRequired , UserProfile , } from '@auth0/nextjs-auth0' ; import { NextApiRequest , NextApiResponse } from 'next' ; import updateSiteName from 'utils/update/updateSiteName' ; async function fetchSitesApi ( req , res ) { const { user } = getSession ( req , res ) ; console . log ( req . body ) ; const data = await updateSiteName ( req . body . siteName , user . sub , req . body . siteId ) ; res . json ( data ) ; } export default withApiAuthRequired ( fetchSitesApi ) ;