fix: block uploading already existing file name

This commit is contained in:
arc-alex
2025-12-11 15:35:41 +01:00
committed by Carlos Valente
parent f0e81c0cf0
commit 77225383a4
3 changed files with 27 additions and 7 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ import sanitize from 'sanitize-filename';
import {
doesProjectExist,
handleImageUpload,
handleUploaded,
handleProjectUploaded,
} from '../../services/project-service/projectServiceUtils.js';
import * as projectService from '../../services/project-service/ProjectService.js';
@@ -129,7 +129,7 @@ export async function postProjectFile(req: Request, res: Response<MessageRespons
try {
const { filename, path } = req.file;
await handleUploaded(path, filename);
await handleProjectUploaded(path, filename);
await projectService.loadProjectFile(filename);
res.status(201).send({