diff --git a/server/src/maintenance/maintenance.service.ts b/server/src/maintenance/maintenance.service.ts index ea822819b..39e8b58a6 100644 --- a/server/src/maintenance/maintenance.service.ts +++ b/server/src/maintenance/maintenance.service.ts @@ -238,6 +238,7 @@ export class MaintenanceService { const update = this.updateGeneratedUser(user.email); const randomIndex = Math.floor(Math.random() * this.images.length); + await this.usersService.updateAvatar({ email: user.email, image: this.images[randomIndex], diff --git a/server/src/teams/teams.service.ts b/server/src/teams/teams.service.ts index a2b8c6da3..95c449619 100644 --- a/server/src/teams/teams.service.ts +++ b/server/src/teams/teams.service.ts @@ -189,14 +189,17 @@ export class TeamsService { /* Checking if the user has an image. If it does, it is removing the image. */ if (candidateTeam.image) { const path = this.getPath(candidateTeam.image, 'image'); - await this.filesService.removeFromS3(path, 'teameights'); + await this.filesService.removeFromS3( + path, + process.env.AWS_S3_BUCKET, + ); } /* Creating a file in the static folder. */ const filePath = await this.filesService.createFile( FileType.TEAMS, dto.image, - 'teameights', + process.env.AWS_S3_BUCKET, ); /* Updating the user with the given email with the new data and returning the updated user. */ diff --git a/server/src/users/users.service.ts b/server/src/users/users.service.ts index 46cdead16..f828a14d3 100644 --- a/server/src/users/users.service.ts +++ b/server/src/users/users.service.ts @@ -396,14 +396,17 @@ export class UsersService { /* Checking if the user has an image. If it does, it is removing the image. */ if (candidate.image) { const path = this.getPath(candidate.image, 'image'); - await this.filesService.removeFromS3(path, 'teameights'); + await this.filesService.removeFromS3( + path, + process.env.AWS_S3_BUCKET, + ); } /* Creating a file in the static folder. */ const filePath = await this.filesService.createFile( FileType.USERS, dto.image, - 'teameights', + process.env.AWS_S3_BUCKET, ); /* Updating the user with the given email with the new data and returning the updated user. */