diff --git a/src/components/features/quiz/CardAviableTest.jsx b/src/components/features/quiz/CardAviableTest.jsx
index fc96db86..a1c6d289 100644
--- a/src/components/features/quiz/CardAviableTest.jsx
+++ b/src/components/features/quiz/CardAviableTest.jsx
@@ -9,7 +9,11 @@ export const CardAvailableTest = ({ title, description, path, status }) => {
return (
{
const [taskText, setTaskText] = useState([]);
const [difficulties, setDifficulties] = useState([]);
const [tomorrowTask, setTomorrowTask] = useState([]);
- const [taskId, setTaskId] = useState('')
+ const [taskId, setTaskId] = useState("");
const [totalHours, setTotalHours] = useState(0);
const [currentDay] = useState(new Date());
const [loader, setLoader] = useState(false);
- const [deleteLoader, setDeleteLoader] = useState(false)
+ const [deleteLoader, setDeleteLoader] = useState(false);
function getReportFromDate(day) {
setLoader(true);
@@ -41,7 +41,7 @@ export const ViewReport = () => {
apiRequest(`reports/find-by-date?user_id=${params.id}&date=${day}`).then(
(res) => {
let spendTime = 0;
- setTaskId(res[0]?.id)
+ setTaskId(res[0]?.id);
for (const item of res) {
if (item.difficulties) {
setDifficulties((prevArray) => [...prevArray, item.difficulties]);
@@ -69,13 +69,13 @@ export const ViewReport = () => {
}
function deleteReport() {
- setDeleteLoader(true)
+ setDeleteLoader(true);
apiRequest(`reports/delete?id=${taskId}`, {
method: "DELETE"
}).then((res) => {
- setDeleteLoader(false)
+ setDeleteLoader(false);
if (res) {
- window.location.replace("/profile/calendar")
+ window.location.replace("/profile/calendar");
}
});
}
@@ -125,23 +125,32 @@ export const ViewReport = () => {
Вернуться
- {localStorage.getItem("role_status") !== "18" &&
+ {localStorage.getItem("role_status") !== "18" && (
-
- {deleteLoader ? :
-
- }
+ )}