Fixed route in view

This commit is contained in:
MaxOvs19 2023-05-16 21:09:28 +03:00
parent 34be4eec32
commit 61d52fae50
2 changed files with 4 additions and 4 deletions

View File

@ -27,6 +27,7 @@ export const ShortReport = ({}) => {
const [tomorrowTask, setTomorrowTask] = useState([]);
const [totalHours, setTotalHours] = useState(0);
const [loader, setLoader] = useState(false);
const [dateTest, setDateTest] = useState("");
function getReportFromDate(day) {
setLoader(true);
@ -40,6 +41,7 @@ export const ShortReport = ({}) => {
).then((res) => {
let spendTime = 0;
for (const item of res) {
setDateTest(item.created_at);
if (item.difficulties) {
setDifficulties((prevArray) => [...prevArray, item.difficulties]);
}
@ -76,9 +78,7 @@ export const ShortReport = ({}) => {
<h2 className="viewReport__title">
Ваши отчеты - <span>просмотр отчета за день</span>
</h2>
<Link to={`profile/view/${reportDate}`}>
Посмотреть подробнее об отчете
</Link>
<Link to={`../view/${dateTest}`}>Посмотреть подробнее об отчете</Link>
</div>
<div className="viewReport__bar">

View File

@ -46,7 +46,6 @@ export const ViewReport = () => {
"cardId"
)}&date=${day}`
).then((res) => {
console.log(res);
let spendTime = 0;
for (const item of res) {
if (item.difficulties) {
@ -122,6 +121,7 @@ export const ViewReport = () => {
</div>
</div>
<div className="viewReport__switchDate">
<Link></Link>
<div
className="viewReport__switchDate__prev switchDate"
onClick={() => previousDay()}