npm i fix + fix d'un comportement incohérent au niveau des usernames.
This commit is contained in:
@@ -4,7 +4,7 @@ WORKDIR /usr/app
|
|||||||
|
|
||||||
COPY ./game_back ./
|
COPY ./game_back ./
|
||||||
|
|
||||||
RUN npm install typescript
|
RUN npm install
|
||||||
|
|
||||||
RUN npx tsc
|
RUN npx tsc
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export class UsersService {
|
|||||||
|
|
||||||
async update(id: number, updateUserDto: UpdateUsersDto, username : string) {
|
async update(id: number, updateUserDto: UpdateUsersDto, username : string) {
|
||||||
console.log("Maj user username : " + username + " updateuser dto " + updateUserDto.username )
|
console.log("Maj user username : " + username + " updateuser dto " + updateUserDto.username )
|
||||||
if (await this.isUsernameExists(updateUserDto.username) === true && updateUserDto.username !== username) {
|
if (await this.isUsernameExists(updateUserDto.username) === true && updateUserDto.username.toLowerCase() !== username.toLowerCase()) {
|
||||||
// console.log('updating username ' + updateUserDto.username + ' but it already is in use')
|
// console.log('updating username ' + updateUserDto.username + ' but it already is in use')
|
||||||
throw new HttpException(`The username is already in use.`,HttpStatus.CONFLICT);
|
throw new HttpException(`The username is already in use.`,HttpStatus.CONFLICT);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user