mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 14:44:43 -04:00
refactor(note-permissions-dto): do not embed User objects
This is part of an effort to consistently not embed User objects in API responses. Usernames are returned instead. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
6cd3feb82c
commit
b955faa983
4 changed files with 9 additions and 12 deletions
|
@ -373,7 +373,7 @@ export class NotesService {
|
|||
const userPermissions = await note.userPermissions;
|
||||
const groupPermissions = await note.groupPermissions;
|
||||
return {
|
||||
owner: owner ? this.usersService.toUserDto(owner) : null,
|
||||
owner: owner ? owner.username : null,
|
||||
sharedToUsers: userPermissions.map((noteUserPermission) => ({
|
||||
user: this.usersService.toUserDto(noteUserPermission.user),
|
||||
canEdit: noteUserPermission.canEdit,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue