Fixed route in view
This commit is contained in:
parent
34be4eec32
commit
61d52fae50
@ -27,6 +27,7 @@ export const ShortReport = ({}) => {
|
|||||||
const [tomorrowTask, setTomorrowTask] = useState([]);
|
const [tomorrowTask, setTomorrowTask] = useState([]);
|
||||||
const [totalHours, setTotalHours] = useState(0);
|
const [totalHours, setTotalHours] = useState(0);
|
||||||
const [loader, setLoader] = useState(false);
|
const [loader, setLoader] = useState(false);
|
||||||
|
const [dateTest, setDateTest] = useState("");
|
||||||
|
|
||||||
function getReportFromDate(day) {
|
function getReportFromDate(day) {
|
||||||
setLoader(true);
|
setLoader(true);
|
||||||
@ -40,6 +41,7 @@ export const ShortReport = ({}) => {
|
|||||||
).then((res) => {
|
).then((res) => {
|
||||||
let spendTime = 0;
|
let spendTime = 0;
|
||||||
for (const item of res) {
|
for (const item of res) {
|
||||||
|
setDateTest(item.created_at);
|
||||||
if (item.difficulties) {
|
if (item.difficulties) {
|
||||||
setDifficulties((prevArray) => [...prevArray, item.difficulties]);
|
setDifficulties((prevArray) => [...prevArray, item.difficulties]);
|
||||||
}
|
}
|
||||||
@ -76,9 +78,7 @@ export const ShortReport = ({}) => {
|
|||||||
<h2 className="viewReport__title">
|
<h2 className="viewReport__title">
|
||||||
Ваши отчеты - <span>просмотр отчета за день</span>
|
Ваши отчеты - <span>просмотр отчета за день</span>
|
||||||
</h2>
|
</h2>
|
||||||
<Link to={`profile/view/${reportDate}`}>
|
<Link to={`../view/${dateTest}`}>Посмотреть подробнее об отчете</Link>
|
||||||
Посмотреть подробнее об отчете
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="viewReport__bar">
|
<div className="viewReport__bar">
|
||||||
|
@ -46,7 +46,6 @@ export const ViewReport = () => {
|
|||||||
"cardId"
|
"cardId"
|
||||||
)}&date=${day}`
|
)}&date=${day}`
|
||||||
).then((res) => {
|
).then((res) => {
|
||||||
console.log(res);
|
|
||||||
let spendTime = 0;
|
let spendTime = 0;
|
||||||
for (const item of res) {
|
for (const item of res) {
|
||||||
if (item.difficulties) {
|
if (item.difficulties) {
|
||||||
@ -122,6 +121,7 @@ export const ViewReport = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="viewReport__switchDate">
|
<div className="viewReport__switchDate">
|
||||||
|
<Link></Link>
|
||||||
<div
|
<div
|
||||||
className="viewReport__switchDate__prev switchDate"
|
className="viewReport__switchDate__prev switchDate"
|
||||||
onClick={() => previousDay()}
|
onClick={() => previousDay()}
|
Loading…
Reference in New Issue
Block a user