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