Update UserStatistics component to include username parameter in getStatistics API call

This commit is contained in:
Davenludd 2024-04-15 12:02:40 +02:00
parent 128221a6ed
commit a5a94c7839

View file

@ -18,9 +18,14 @@ export default function UserStatistics(): JSX.Element {
const token = localStorage.getItem("accessToken") ?? "";
const { projectName } = useParams();
const { username } = useParams();
const fetchTimePerActivity = async (): Promise<void> => {
const response = await api.getStatistics(projectName ?? "", token);
const response = await api.getStatistics(
projectName ?? "",
token,
username ?? "",
);
{
if (response.success) {
const statistics: Statistics = response.data ?? {