employeeReport
This commit is contained in:
@ -32,6 +32,7 @@ import rectangle from "assets/images/rectangle__calendar.png";
|
||||
|
||||
export const ProfileCalendarComponent = React.memo(
|
||||
({
|
||||
userId,
|
||||
value,
|
||||
setValueHandler,
|
||||
reports,
|
||||
@ -94,9 +95,17 @@ export const ProfileCalendarComponent = React.memo(
|
||||
new Date(day).getMonth() + 1
|
||||
)}-${correctDay(new Date(day).getDate())}` === date.created_at
|
||||
) {
|
||||
return `../view/${date.created_at}`;
|
||||
if (userId) {
|
||||
return `../view/${date.created_at}/${userId}`
|
||||
}
|
||||
return `../view/${date.created_at}/${localStorage.getItem("id")}`;
|
||||
}
|
||||
}
|
||||
|
||||
if (userId) {
|
||||
return "#"
|
||||
}
|
||||
|
||||
return "../../report";
|
||||
}
|
||||
|
||||
@ -114,7 +123,7 @@ export const ProfileCalendarComponent = React.memo(
|
||||
startDate._d
|
||||
)}`;
|
||||
apiRequest(
|
||||
`/reports/index?${requestDates}&user_id =${localStorage.getItem("id")}`
|
||||
`/reports/index?${requestDates}&user_id=${userId ? userId : localStorage.getItem("id")}`
|
||||
).then((reports) => {
|
||||
let spendTime = 0;
|
||||
reports.map((report) => {
|
||||
@ -163,7 +172,9 @@ export const ProfileCalendarComponent = React.memo(
|
||||
<div className="calendar-component">
|
||||
<div className="calendar-component__header">
|
||||
<div className="calendar-component__header-info">
|
||||
<h3>Мои отчеты за </h3>
|
||||
{!userId &&
|
||||
<h3>Мои отчеты за </h3>
|
||||
}
|
||||
<p className="calendar__hours">
|
||||
{month}
|
||||
<span>
|
||||
|
Reference in New Issue
Block a user