mirror of
https://github.com/D4M13N-D3V/comissions-app-ui.git
synced 2025-03-14 08:15:08 +00:00
30 lines
913 B
TypeScript
30 lines
913 B
TypeScript
![]() |
import { getAccessToken, withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
|
||
|
|
||
|
export default withApiAuthRequired(async function pageSettings(req, res) {
|
||
|
const { accessToken } = await getAccessToken(req, res);
|
||
|
if(req.method !== 'GET') {
|
||
|
const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist/Page', {
|
||
|
headers: {
|
||
|
"Authorization": `Bearer ${accessToken}`,
|
||
|
"Content-Type": "application/json"
|
||
|
},
|
||
|
method: "PUT",
|
||
|
body: JSON.stringify(req.body)
|
||
|
});
|
||
|
let result = await response.json();
|
||
|
res.status(200).json(result);
|
||
|
}
|
||
|
else{
|
||
|
const response = await fetch(process.env.NEXT_PUBLIC_API_URL+'/api/Artist/Page', {
|
||
|
headers: {
|
||
|
"Authorization": `Bearer ${accessToken}`
|
||
|
}
|
||
|
});
|
||
|
|
||
|
//console.log(response)
|
||
|
let result = await response.json();
|
||
|
res.status(200).json(result);
|
||
|
}
|
||
|
});
|
||
|
|