Fix upload file issue
This commit is contained in:
@@ -81,10 +81,10 @@ export class UsersService {
|
||||
}
|
||||
|
||||
async getProfilePicture(userId: number, res: any) {
|
||||
const path = `/data/${userId}.png`;
|
||||
const path = `/data/${userId}.jpg`;
|
||||
if (existsSync(path)) {
|
||||
const file = createReadStream(path);
|
||||
return new StreamableFile(file);
|
||||
return file.pipe(res);
|
||||
}
|
||||
// We could not find a profile icon locally, using gravatar instead.
|
||||
const user = await this.user({ id: userId });
|
||||
|
||||
1
data/.gitignore
vendored
Normal file
1
data/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*
|
||||
@@ -9,7 +9,7 @@ services:
|
||||
volumes:
|
||||
- ./back:/app
|
||||
- ./assets:/assets
|
||||
- data:/data
|
||||
- ./data:/data
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
@@ -55,6 +55,3 @@ services:
|
||||
- "back"
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
- .env
|
||||
volumes:
|
||||
- ./assets:/assets
|
||||
- data:/data
|
||||
- ./data:/data
|
||||
scorometer:
|
||||
image: ghcr.io/chroma-case/scorometer:main
|
||||
ports:
|
||||
@@ -44,6 +44,3 @@ services:
|
||||
- "back"
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
- .env
|
||||
volumes:
|
||||
- ./assets:/assets
|
||||
- data:/data
|
||||
- ./data:/data
|
||||
scorometer:
|
||||
build: ./scorometer
|
||||
ports:
|
||||
@@ -53,4 +53,3 @@ services:
|
||||
|
||||
volumes:
|
||||
db:
|
||||
data:
|
||||
|
||||
Reference in New Issue
Block a user