Refactir logging mission deep

This commit is contained in:
alma 2026-01-07 11:59:30 +01:00
parent dce71a2cb3
commit 929081b664

View File

@ -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<void> {
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<void> {
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