mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): user endpoints (#9730)
* refactor(server): user endpoints * fix repos * fix unit tests --------- Co-authored-by: Daniel Dietzler <mail@ddietzler.dev> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
e7c8501930
commit
75830a4878
80 changed files with 2453 additions and 1914 deletions
|
|
@ -12,7 +12,7 @@ import {
|
|||
SignUpDto,
|
||||
ValidateAccessTokenResponseDto,
|
||||
} from 'src/dtos/auth.dto';
|
||||
import { UserResponseDto, mapUser } from 'src/dtos/user.dto';
|
||||
import { UserAdminResponseDto } from 'src/dtos/user.dto';
|
||||
import { Auth, Authenticated, GetLoginDetails } from 'src/middleware/auth.guard';
|
||||
import { AuthService, LoginDetails } from 'src/services/auth.service';
|
||||
import { respondWithCookie, respondWithoutCookie } from 'src/utils/response';
|
||||
|
|
@ -40,7 +40,7 @@ export class AuthController {
|
|||
}
|
||||
|
||||
@Post('admin-sign-up')
|
||||
signUpAdmin(@Body() dto: SignUpDto): Promise<UserResponseDto> {
|
||||
signUpAdmin(@Body() dto: SignUpDto): Promise<UserAdminResponseDto> {
|
||||
return this.service.adminSignUp(dto);
|
||||
}
|
||||
|
||||
|
|
@ -54,8 +54,8 @@ export class AuthController {
|
|||
@Post('change-password')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Authenticated()
|
||||
changePassword(@Auth() auth: AuthDto, @Body() dto: ChangePasswordDto): Promise<UserResponseDto> {
|
||||
return this.service.changePassword(auth, dto).then(mapUser);
|
||||
changePassword(@Auth() auth: AuthDto, @Body() dto: ChangePasswordDto): Promise<UserAdminResponseDto> {
|
||||
return this.service.changePassword(auth, dto);
|
||||
}
|
||||
|
||||
@Post('logout')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue