From 929081b664e06d981343f88bf7b4f1c7581402ba Mon Sep 17 00:00:00 2001 From: alma Date: Wed, 7 Jan 2026 11:59:30 +0100 Subject: [PATCH] Refactir logging mission deep --- lib/mission-uploads.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/mission-uploads.ts b/lib/mission-uploads.ts index 28794171..9e8615cf 100644 --- a/lib/mission-uploads.ts +++ b/lib/mission-uploads.ts @@ -41,10 +41,11 @@ export function getMissionFileUrl(path: string): string { // Helper function to delete a mission logo export async function deleteMissionLogo(missionId: string, logoPath: string): Promise { + const normalizedPath = ensureMissionsPrefix(logoPath); + const minioPath = normalizedPath.replace(/^missions\//, ''); // Remove prefix for Minio + try { const { DeleteObjectCommand } = await import('@aws-sdk/client-s3'); - const normalizedPath = ensureMissionsPrefix(logoPath); - const minioPath = normalizedPath.replace(/^missions\//, ''); // Remove prefix for Minio logger.debug('Deleting mission logo', { missionId, @@ -71,10 +72,11 @@ export async function deleteMissionLogo(missionId: string, logoPath: string): Pr // Helper function to delete a mission attachment export async function deleteMissionAttachment(filePath: string): Promise { + const normalizedPath = ensureMissionsPrefix(filePath); + const minioPath = normalizedPath.replace(/^missions\//, ''); // Remove prefix for Minio + try { const { DeleteObjectCommand } = await import('@aws-sdk/client-s3'); - const normalizedPath = ensureMissionsPrefix(filePath); - const minioPath = normalizedPath.replace(/^missions\//, ''); // Remove prefix for Minio logger.debug('Deleting mission attachment', { minioPath