comissions-app-ui/pages/api/artist/artistAccessRequest.tsx
2024-05-21 22:35:13 -04:00

18 lines
565 B
TypeScript

import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
export default withApiAuthRequired(async function products(req, res) {
const { accessToken } = await getAccessToken(req, res);
const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/ArtistAccessRequest', {
headers: {
"Authorization": `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
method: 'POST',
body: req.body
});
console.log(response)
let result = await response.json();
res.status(200).json(result);
});