From 3724cdde8d7988fcf3be2b6db1e9a9dc3dc5330f Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Fri, 30 May 2025 12:31:01 +0300 Subject: [PATCH] =?UTF-8?q?feat=20[P-227]:=20=D1=83=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=BB=20=D0=BD=D0=B5=D0=BD=D1=83=D0=B6=D0=BD=D1=8B=D0=B9=20del?= =?UTF-8?q?ete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/testing/DetailCardTest.vue | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/front/src/components/testing/DetailCardTest.vue b/src/front/src/components/testing/DetailCardTest.vue index de1efe642..7716432b0 100644 --- a/src/front/src/components/testing/DetailCardTest.vue +++ b/src/front/src/components/testing/DetailCardTest.vue @@ -123,30 +123,7 @@ export default { return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`; }); - const deactivateOldTestings = async (testId) => { - try { - const testingResp = await axiosApiInstance.get(`/api/tests/testingview/?test_id=${testId}`); - const userTestings = testingResp.data; - - if (userTestings?.length > 1) { - const sortedTestings = [...userTestings].sort((a, b) => { - return new Date(b.completion_date) - new Date(a.completion_date); - }); - - for (let i = 1; i < sortedTestings.length; i++) { - await axiosApiInstance.delete(`/api/tests/testingview/`, { - data: { id: sortedTestings[i].id } - }); - } - } - } catch (error) { - console.error('Error deactivating old testings:', error); - } - }; - - const startTest = async () => { - await deactivateOldTestings(testId); - + const startTest = async () => { await getTestById(testId); testStarted.value = true;