From e6cd2049e007a1b3cb11d3588428a481f765679b Mon Sep 17 00:00:00 2001 From: Archibald Date: Mon, 9 Jun 2025 21:45:25 +0500 Subject: [PATCH] =?UTF-8?q?=D0=B0=D0=B2=D1=82=D0=BE=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B0=20homepage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API/app/infrastructure/teams_service.py | 4 +- .../project_files/downloadProjectFile.js | 2 +- .../project_files/uploadProjectFile.js | 4 +- WEB/src/pages/HomePage.vue | 118 +++++++++++++----- 4 files changed, 93 insertions(+), 35 deletions(-) diff --git a/API/app/infrastructure/teams_service.py b/API/app/infrastructure/teams_service.py index 3dcfe60..7030570 100644 --- a/API/app/infrastructure/teams_service.py +++ b/API/app/infrastructure/teams_service.py @@ -4,7 +4,7 @@ from typing import Optional, Any, Coroutine import aiofiles from fastapi import HTTPException, status, UploadFile -from magic import magic +from magic import Magic from sqlalchemy.ext.asyncio import AsyncSession from starlette.responses import FileResponse from werkzeug.utils import secure_filename @@ -152,7 +152,7 @@ class TeamsService: @staticmethod def validate_file_type(file: UploadFile): - mime = magic.Magic(mime=True) + mime = Magic(mime=True) file_type = mime.from_buffer(file.file.read(1024)) file.file.seek(0) diff --git a/WEB/src/api/projects/project_files/downloadProjectFile.js b/WEB/src/api/projects/project_files/downloadProjectFile.js index 8a5ea58..a988ee9 100644 --- a/WEB/src/api/projects/project_files/downloadProjectFile.js +++ b/WEB/src/api/projects/project_files/downloadProjectFile.js @@ -4,7 +4,7 @@ import CONFIG from '@/core/config.js'; const downloadProjectFile = async (fileId) => { try { const response = await axios.get( - `${CONFIG.BASE_URL}/project_files/${fileId}/download`, + `${CONFIG.BASE_URL}/project_files/${fileId}/download/`, { responseType: 'blob', withCredentials: true, diff --git a/WEB/src/api/projects/project_files/uploadProjectFile.js b/WEB/src/api/projects/project_files/uploadProjectFile.js index 7a5605f..ff6c20c 100644 --- a/WEB/src/api/projects/project_files/uploadProjectFile.js +++ b/WEB/src/api/projects/project_files/uploadProjectFile.js @@ -9,7 +9,7 @@ const uploadProjectFile = async (projectId, file) => { formData.append("file", file); const response = await axios.post( - `${CONFIG.BASE_URL}/project_files/projects/${projectId}/upload`, + `${CONFIG.BASE_URL}/project_files/projects/${projectId}/upload/`, formData, { headers: { @@ -36,4 +36,4 @@ const uploadProjectFile = async (projectId, file) => { } }; -export default uploadProjectFile; \ No newline at end of file +export default uploadProjectFile; diff --git a/WEB/src/pages/HomePage.vue b/WEB/src/pages/HomePage.vue index ca6033d..670b7ed 100644 --- a/WEB/src/pages/HomePage.vue +++ b/WEB/src/pages/HomePage.vue @@ -2,13 +2,13 @@
-
- + {{ teamName }} @@ -122,13 +122,16 @@