Commit ffe7ce06 by Augusto

remove logs

parent 2b389c43
......@@ -41,14 +41,12 @@ export async function saveUserSignature(
await mkdir(baseUploadPath, { recursive: true, mode: 0o755 });
// Then create the signatures directory
await mkdir(uploadDir, { recursive: true, mode: 0o755 });
console.log(`Created signatures directory: ${uploadDir}`);
} catch (error) {
console.error('Error creating upload directory:', error);
// Fallback to temp directory if main upload directory fails
finalUploadDir = path.join('/tmp', 'uploads', 'signatures');
try {
await mkdir(finalUploadDir, { recursive: true, mode: 0o755 });
console.log(`Created fallback signatures directory: ${finalUploadDir}`);
} catch (fallbackError) {
console.error('Error creating fallback directory:', fallbackError);
throw new Error('Failed to create upload directory');
......@@ -63,7 +61,6 @@ export async function saveUserSignature(
try {
await writeFile(filePath, file.buffer);
console.log(`Signature file saved to: ${filePath}`);
// Generate the URL path based on the actual directory used
let urlPath;
......@@ -74,7 +71,6 @@ export async function saveUserSignature(
urlPath = `/uploads/signatures/${filename}`;
}
console.log(`Signature file URL: ${urlPath}`);
return urlPath;
} catch (error) {
console.error(`Error saving signature file ${filename}:`, error);
......@@ -120,14 +116,12 @@ export async function savePartnerLogo(
await mkdir(baseUploadPath, { recursive: true, mode: 0o755 });
// Then create the logos directory
await mkdir(uploadDir, { recursive: true, mode: 0o755 });
console.log(`Created logos directory: ${uploadDir}`);
} catch (error) {
console.error('Error creating upload directory:', error);
// Fallback to temp directory if main upload directory fails
finalUploadDir = path.join('/tmp', 'uploads', 'logos');
try {
await mkdir(finalUploadDir, { recursive: true, mode: 0o755 });
console.log(`Created fallback logos directory: ${finalUploadDir}`);
} catch (fallbackError) {
console.error('Error creating fallback directory:', fallbackError);
throw new Error('Failed to create upload directory');
......@@ -142,7 +136,6 @@ export async function savePartnerLogo(
try {
await writeFile(filePath, file.buffer);
console.log(`Logo file saved to: ${filePath}`);
// Generate the URL path based on the actual directory used
let urlPath;
......@@ -153,7 +146,6 @@ export async function savePartnerLogo(
urlPath = `/uploads/logos/${filename}`;
}
console.log(`Logo file URL: ${urlPath}`);
return urlPath;
} catch (error) {
console.error(`Error saving logo file ${filename}:`, error);
......
......@@ -52,12 +52,6 @@ async function bootstrap() {
}),
);
// Debug: Log static file serving configuration
console.log(`Static file serving configured for: ${uploadBasePath}`);
console.log(
`Files should be accessible at: /uploads/signatures/ and /uploads/logos/`,
);
// Serve fallback uploads from /tmp if needed
app.use(
'/tmp-uploads',
......
......@@ -65,7 +65,6 @@ export async function saveInspectionPhotos(
try {
await mkdir(fallbackDir, { recursive: true });
finalUploadDir = fallbackDir;
console.log(`Using fallback directory: ${finalUploadDir}`);
} catch (fallbackError) {
console.error(
`Fallback directory creation also failed:`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment