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