Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Unike
/
UnikeInspection-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ffe7ce06
authored
Oct 06, 2025
by
Augusto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove logs
parent
2b389c43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
15 deletions
+0
-15
src/common/utils/file-upload.utils.ts
+0
-8
src/main.ts
+0
-6
src/modules/inspection/inspection.utils.ts
+0
-1
No files found.
src/common/utils/file-upload.utils.ts
View file @
ffe7ce06
...
...
@@ -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
);
...
...
src/main.ts
View file @
ffe7ce06
...
...
@@ -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'
,
...
...
src/modules/inspection/inspection.utils.ts
View file @
ffe7ce06
...
...
@@ -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:`
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment