mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-25 04:24:43 -04:00
feat(user-info-dto): split email into separate DTO
The email address should only be available in /me routes. This commit splits the email address into a new FullUserInfoDto. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
a7edf00ebc
commit
0394679134
7 changed files with 44 additions and 12 deletions
|
@ -10,7 +10,7 @@ import { SessionGuard } from '../../../identity/session.guard';
|
|||
import { ConsoleLoggerService } from '../../../logger/console-logger.service';
|
||||
import { MediaUploadDto } from '../../../media/media-upload.dto';
|
||||
import { MediaService } from '../../../media/media.service';
|
||||
import { UserInfoDto } from '../../../users/user-info.dto';
|
||||
import { FullUserInfoDto } from '../../../users/user-info.dto';
|
||||
import { User } from '../../../users/user.entity';
|
||||
import { UsersService } from '../../../users/users.service';
|
||||
import { OpenApi } from '../../utils/openapi.decorator';
|
||||
|
@ -28,10 +28,11 @@ export class MeController {
|
|||
) {
|
||||
this.logger.setContext(MeController.name);
|
||||
}
|
||||
|
||||
@Get()
|
||||
@OpenApi(200)
|
||||
getMe(@RequestUser() user: User): UserInfoDto {
|
||||
return this.userService.toUserDto(user);
|
||||
getMe(@RequestUser() user: User): FullUserInfoDto {
|
||||
return this.userService.toFullUserDto(user);
|
||||
}
|
||||
|
||||
@Get('media')
|
||||
|
|
|
@ -24,7 +24,7 @@ import { MediaService } from '../../../media/media.service';
|
|||
import { NoteMetadataDto } from '../../../notes/note-metadata.dto';
|
||||
import { Note } from '../../../notes/note.entity';
|
||||
import { NotesService } from '../../../notes/notes.service';
|
||||
import { UserInfoDto } from '../../../users/user-info.dto';
|
||||
import { FullUserInfoDto } from '../../../users/user-info.dto';
|
||||
import { User } from '../../../users/user.entity';
|
||||
import { UsersService } from '../../../users/users.service';
|
||||
import { GetNoteInterceptor } from '../../utils/get-note.interceptor';
|
||||
|
@ -52,10 +52,10 @@ export class MeController {
|
|||
@OpenApi({
|
||||
code: 200,
|
||||
description: 'The user information',
|
||||
dto: UserInfoDto,
|
||||
dto: FullUserInfoDto,
|
||||
})
|
||||
getMe(@RequestUser() user: User): UserInfoDto {
|
||||
return this.usersService.toUserDto(user);
|
||||
getMe(@RequestUser() user: User): FullUserInfoDto {
|
||||
return this.usersService.toFullUserDto(user);
|
||||
}
|
||||
|
||||
@Get('history')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue