fix: change property name in backend DTO

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-10-07 15:33:19 +02:00
parent a8b3b117dc
commit 5d396eb99c
3 changed files with 6 additions and 6 deletions

View file

@ -37,7 +37,7 @@ export class UserInfoDto extends BaseDto {
format: 'uri', format: 'uri',
}) })
@IsString() @IsString()
photo: string; photoUrl: string;
} }
/** /**

View file

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
* *
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
@ -147,7 +147,7 @@ describe('UsersService', () => {
const userDto = service.toUserDto(user); const userDto = service.toUserDto(user);
expect(userDto.username).toEqual(username); expect(userDto.username).toEqual(username);
expect(userDto.displayName).toEqual(displayname); expect(userDto.displayName).toEqual(displayname);
expect(userDto.photo).toEqual(''); expect(userDto.photoUrl).toEqual('');
}); });
}); });
@ -159,7 +159,7 @@ describe('UsersService', () => {
const userDto = service.toFullUserDto(user); const userDto = service.toFullUserDto(user);
expect(userDto.username).toEqual(username); expect(userDto.username).toEqual(username);
expect(userDto.displayName).toEqual(displayname); expect(userDto.displayName).toEqual(displayname);
expect(userDto.photo).toEqual(''); expect(userDto.photoUrl).toEqual('');
expect(userDto.email).toEqual(''); expect(userDto.email).toEqual('');
}); });
}); });

View file

@ -119,7 +119,7 @@ export class UsersService {
return { return {
username: user.username, username: user.username,
displayName: user.displayName, displayName: user.displayName,
photo: this.getPhotoUrl(user), photoUrl: this.getPhotoUrl(user),
}; };
} }
@ -132,7 +132,7 @@ export class UsersService {
return { return {
username: user.username, username: user.username,
displayName: user.displayName, displayName: user.displayName,
photo: this.getPhotoUrl(user), photoUrl: this.getPhotoUrl(user),
email: user.email ?? '', email: user.email ?? '',
}; };
} }