Skip to content

Commit 5ce2f5c

Browse files
authored
Merge pull request #138 from fredrikj31/fix-profile-image-uploading
fix profile image uploading
2 parents bc6ad09 + 7b72f08 commit 5ce2f5c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

api/src/routes/uploads/handlers/uploadProfilePicture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const uploadProfilePictureHandler = async ({
2828
try {
2929
await access(folderPath);
3030
} catch {
31-
await mkdir(folderPath);
31+
await mkdir(folderPath, { recursive: true });
3232
}
3333

3434
// Stream file uploading to folder

docker-compose.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ services:
7575
DB_NAME: thoughts
7676
DB_USER: ${DB_USER}
7777
DB_PASSWORD: ${DB_PASSWORD}
78-
UPLOADS_FILE_PATH: ${UPLOADS_FILE_PATH}
78+
UPLOADS_FILE_PATH: /files${UPLOADS_FILE_PATH} # /files is the root folder, which is the container's mount point
7979
networks:
8080
- thoughts-network
8181
- cloudflared
82+
volumes:
83+
- assets-data:/files # /files is the root folder, which is the container's mount point
8284
ports:
8385
- 3002:3000
8486

0 commit comments

Comments
 (0)