wip: use ssr

This commit is contained in:
Jayden Pyles
2024-07-23 14:25:53 -05:00
parent c396746587
commit ffced1ebf2
19 changed files with 148 additions and 131 deletions

View File

@@ -2,6 +2,7 @@ import React, { useEffect, useRef, useState } from "react";
import { Chart, registerables } from "chart.js";
import { Box, Typography, useTheme } from "@mui/material";
import { useAuth } from "../contexts/AuthContext";
import { Constants } from "../lib";
Chart.register(...registerables);
@@ -17,7 +18,7 @@ const Statistics: React.FC = () => {
const fetchElementsData = async () => {
try {
const response = await fetch(
"/api/statistics/get-average-element-per-link",
`${Constants.DOMAIN}/api/statistics/get-average-element-per-link`,
{
method: "POST",
headers: { "Content-Type": "application/json" },
@@ -91,7 +92,7 @@ const Statistics: React.FC = () => {
const fetchJobsData = async () => {
try {
const response = await fetch(
"/api/statistics/get-average-jobs-per-day",
`${Constants.DOMAIN}/api/statistics/get-average-jobs-per-day`,
{
method: "POST",
headers: { "Content-Type": "application/json" },