Fix upload file issue

This commit is contained in:
2023-07-23 18:07:11 +09:00
parent 74cd9c0df2
commit 930191569f
5 changed files with 6 additions and 12 deletions
+2 -2
View File
@@ -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 });