fix: make calls to next server

This commit is contained in:
Jayden Pyles
2024-11-12 21:34:47 -06:00
parent b3bf780eda
commit dc4d219205
26 changed files with 654 additions and 105 deletions

View File

@@ -75,15 +75,12 @@ const Statistics: React.FC<StatProps> = ({ averageElement, averageJob }) => {
const fetchElementsData = async () => {
try {
const response = await fetch(
`${process.env.NEXT_PUBLIC_API_URL}/api/statistics/get-average-element-per-link`,
{
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},
}
);
const response = await fetch("/api/get-average-element-per-link", {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},
});
const data = await response.json();
setElementsData(data);
} catch (error) {
@@ -93,10 +90,8 @@ const Statistics: React.FC<StatProps> = ({ averageElement, averageJob }) => {
const fetchJobsData = async () => {
try {
const response = await fetch(
`${process.env.NEXT_PUBLIC_API_URL}/api/statistics/get-average-jobs-per-day`,
{
headers: {
const response = await fetch("/api/get-average-jobs-per-day", {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${token}`,
},