Refactir logging mission deep
This commit is contained in:
parent
dce71a2cb3
commit
929081b664
@ -41,11 +41,12 @@ export function getMissionFileUrl(path: string): string {
|
|||||||
|
|
||||||
// Helper function to delete a mission logo
|
// Helper function to delete a mission logo
|
||||||
export async function deleteMissionLogo(missionId: string, logoPath: string): Promise<void> {
|
export async function deleteMissionLogo(missionId: string, logoPath: string): Promise<void> {
|
||||||
try {
|
|
||||||
const { DeleteObjectCommand } = await import('@aws-sdk/client-s3');
|
|
||||||
const normalizedPath = ensureMissionsPrefix(logoPath);
|
const normalizedPath = ensureMissionsPrefix(logoPath);
|
||||||
const minioPath = normalizedPath.replace(/^missions\//, ''); // Remove prefix for Minio
|
const minioPath = normalizedPath.replace(/^missions\//, ''); // Remove prefix for Minio
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { DeleteObjectCommand } = await import('@aws-sdk/client-s3');
|
||||||
|
|
||||||
logger.debug('Deleting mission logo', {
|
logger.debug('Deleting mission logo', {
|
||||||
missionId,
|
missionId,
|
||||||
minioPath
|
minioPath
|
||||||
@ -71,11 +72,12 @@ export async function deleteMissionLogo(missionId: string, logoPath: string): Pr
|
|||||||
|
|
||||||
// Helper function to delete a mission attachment
|
// Helper function to delete a mission attachment
|
||||||
export async function deleteMissionAttachment(filePath: string): Promise<void> {
|
export async function deleteMissionAttachment(filePath: string): Promise<void> {
|
||||||
try {
|
|
||||||
const { DeleteObjectCommand } = await import('@aws-sdk/client-s3');
|
|
||||||
const normalizedPath = ensureMissionsPrefix(filePath);
|
const normalizedPath = ensureMissionsPrefix(filePath);
|
||||||
const minioPath = normalizedPath.replace(/^missions\//, ''); // Remove prefix for Minio
|
const minioPath = normalizedPath.replace(/^missions\//, ''); // Remove prefix for Minio
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { DeleteObjectCommand } = await import('@aws-sdk/client-s3');
|
||||||
|
|
||||||
logger.debug('Deleting mission attachment', {
|
logger.debug('Deleting mission attachment', {
|
||||||
minioPath
|
minioPath
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user