feat: simplify uploads directory path assignment by removing redundant process.cwd() call
All checks were successful
Build Docker Image / build (push) Successful in 1m22s
All checks were successful
Build Docker Image / build (push) Successful in 1m22s
This commit is contained in:
@@ -110,7 +110,7 @@ export const actions: Actions = {
|
||||
const hasUploadedPicture = !!pictureFile && pictureFile.size > 0;
|
||||
if (hasUploadedPicture) {
|
||||
try {
|
||||
const uploadsDir = join(process.cwd(), env.UPLOAD_FOLDER || 'uploads');
|
||||
const uploadsDir = env.UPLOAD_FOLDER || join(process.cwd(),'uploads');
|
||||
if (!existsSync(uploadsDir)) {
|
||||
mkdirSync(uploadsDir, { recursive: true });
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export const GET: RequestHandler = async ({ params }) => {
|
||||
}
|
||||
|
||||
try {
|
||||
const uploadsDir = join(process.cwd(), env.UPLOAD_FOLDER || 'uploads');
|
||||
const uploadsDir = env.UPLOAD_FOLDER || join(process.cwd(),'uploads');
|
||||
const filepath = join(uploadsDir, filename);
|
||||
|
||||
if (!existsSync(filepath)) {
|
||||
|
||||
Reference in New Issue
Block a user