Commit ffe7ce06 by Augusto

remove logs

parent 2b389c43
...@@ -41,14 +41,12 @@ export async function saveUserSignature( ...@@ -41,14 +41,12 @@ export async function saveUserSignature(
await mkdir(baseUploadPath, { recursive: true, mode: 0o755 }); await mkdir(baseUploadPath, { recursive: true, mode: 0o755 });
// Then create the signatures directory // Then create the signatures directory
await mkdir(uploadDir, { recursive: true, mode: 0o755 }); await mkdir(uploadDir, { recursive: true, mode: 0o755 });
console.log(`Created signatures directory: ${uploadDir}`);
} catch (error) { } catch (error) {
console.error('Error creating upload directory:', error); console.error('Error creating upload directory:', error);
// Fallback to temp directory if main upload directory fails // Fallback to temp directory if main upload directory fails
finalUploadDir = path.join('/tmp', 'uploads', 'signatures'); finalUploadDir = path.join('/tmp', 'uploads', 'signatures');
try { try {
await mkdir(finalUploadDir, { recursive: true, mode: 0o755 }); await mkdir(finalUploadDir, { recursive: true, mode: 0o755 });
console.log(`Created fallback signatures directory: ${finalUploadDir}`);
} catch (fallbackError) { } catch (fallbackError) {
console.error('Error creating fallback directory:', fallbackError); console.error('Error creating fallback directory:', fallbackError);
throw new Error('Failed to create upload directory'); throw new Error('Failed to create upload directory');
...@@ -63,7 +61,6 @@ export async function saveUserSignature( ...@@ -63,7 +61,6 @@ export async function saveUserSignature(
try { try {
await writeFile(filePath, file.buffer); await writeFile(filePath, file.buffer);
console.log(`Signature file saved to: ${filePath}`);
// Generate the URL path based on the actual directory used // Generate the URL path based on the actual directory used
let urlPath; let urlPath;
...@@ -74,7 +71,6 @@ export async function saveUserSignature( ...@@ -74,7 +71,6 @@ export async function saveUserSignature(
urlPath = `/uploads/signatures/${filename}`; urlPath = `/uploads/signatures/${filename}`;
} }
console.log(`Signature file URL: ${urlPath}`);
return urlPath; return urlPath;
} catch (error) { } catch (error) {
console.error(`Error saving signature file ${filename}:`, error); console.error(`Error saving signature file ${filename}:`, error);
...@@ -120,14 +116,12 @@ export async function savePartnerLogo( ...@@ -120,14 +116,12 @@ export async function savePartnerLogo(
await mkdir(baseUploadPath, { recursive: true, mode: 0o755 }); await mkdir(baseUploadPath, { recursive: true, mode: 0o755 });
// Then create the logos directory // Then create the logos directory
await mkdir(uploadDir, { recursive: true, mode: 0o755 }); await mkdir(uploadDir, { recursive: true, mode: 0o755 });
console.log(`Created logos directory: ${uploadDir}`);
} catch (error) { } catch (error) {
console.error('Error creating upload directory:', error); console.error('Error creating upload directory:', error);
// Fallback to temp directory if main upload directory fails // Fallback to temp directory if main upload directory fails
finalUploadDir = path.join('/tmp', 'uploads', 'logos'); finalUploadDir = path.join('/tmp', 'uploads', 'logos');
try { try {
await mkdir(finalUploadDir, { recursive: true, mode: 0o755 }); await mkdir(finalUploadDir, { recursive: true, mode: 0o755 });
console.log(`Created fallback logos directory: ${finalUploadDir}`);
} catch (fallbackError) { } catch (fallbackError) {
console.error('Error creating fallback directory:', fallbackError); console.error('Error creating fallback directory:', fallbackError);
throw new Error('Failed to create upload directory'); throw new Error('Failed to create upload directory');
...@@ -142,7 +136,6 @@ export async function savePartnerLogo( ...@@ -142,7 +136,6 @@ export async function savePartnerLogo(
try { try {
await writeFile(filePath, file.buffer); await writeFile(filePath, file.buffer);
console.log(`Logo file saved to: ${filePath}`);
// Generate the URL path based on the actual directory used // Generate the URL path based on the actual directory used
let urlPath; let urlPath;
...@@ -153,7 +146,6 @@ export async function savePartnerLogo( ...@@ -153,7 +146,6 @@ export async function savePartnerLogo(
urlPath = `/uploads/logos/${filename}`; urlPath = `/uploads/logos/${filename}`;
} }
console.log(`Logo file URL: ${urlPath}`);
return urlPath; return urlPath;
} catch (error) { } catch (error) {
console.error(`Error saving logo file ${filename}:`, error); console.error(`Error saving logo file ${filename}:`, error);
......
...@@ -52,12 +52,6 @@ async function bootstrap() { ...@@ -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 // Serve fallback uploads from /tmp if needed
app.use( app.use(
'/tmp-uploads', '/tmp-uploads',
......
...@@ -65,7 +65,6 @@ export async function saveInspectionPhotos( ...@@ -65,7 +65,6 @@ export async function saveInspectionPhotos(
try { try {
await mkdir(fallbackDir, { recursive: true }); await mkdir(fallbackDir, { recursive: true });
finalUploadDir = fallbackDir; finalUploadDir = fallbackDir;
console.log(`Using fallback directory: ${finalUploadDir}`);
} catch (fallbackError) { } catch (fallbackError) {
console.error( console.error(
`Fallback directory creation also failed:`, `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