Update UserStatistics component to include username parameter in getStatistics API call
This commit is contained in:
parent
128221a6ed
commit
a5a94c7839
1 changed files with 6 additions and 1 deletions
|
@ -18,9 +18,14 @@ export default function UserStatistics(): JSX.Element {
|
||||||
|
|
||||||
const token = localStorage.getItem("accessToken") ?? "";
|
const token = localStorage.getItem("accessToken") ?? "";
|
||||||
const { projectName } = useParams();
|
const { projectName } = useParams();
|
||||||
|
const { username } = useParams();
|
||||||
|
|
||||||
const fetchTimePerActivity = async (): Promise<void> => {
|
const fetchTimePerActivity = async (): Promise<void> => {
|
||||||
const response = await api.getStatistics(projectName ?? "", token);
|
const response = await api.getStatistics(
|
||||||
|
projectName ?? "",
|
||||||
|
token,
|
||||||
|
username ?? "",
|
||||||
|
);
|
||||||
{
|
{
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
const statistics: Statistics = response.data ?? {
|
const statistics: Statistics = response.data ?? {
|
||||||
|
|
Loading…
Reference in a new issue