2024-02-25 18:34:51 -05:00
|
|
|
import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
|
|
|
|
|
2024-03-03 16:19:47 -05:00
|
|
|
export default withApiAuthRequired(async function handler(req, res) {
|
2024-02-25 18:34:51 -05:00
|
|
|
const { accessToken } = await getAccessToken(req, res);
|
2024-03-03 16:03:22 -05:00
|
|
|
const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/admin/AdminArtistRequests/Count', {
|
2024-02-25 18:34:51 -05:00
|
|
|
headers: {
|
2024-03-03 16:03:22 -05:00
|
|
|
"Authorization": `Bearer ${accessToken}`
|
|
|
|
}
|
2024-02-25 18:34:51 -05:00
|
|
|
});
|
|
|
|
if(response.ok==false){
|
|
|
|
res.status(200).json({})
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
let result = await response.json();
|
|
|
|
res.status(200).json(result);
|
|
|
|
});
|