mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
Update get user info controller to avoid conflict with /count
This commit is contained in:
parent
c6ecfb679a
commit
cbdb8fa51f
7 changed files with 5 additions and 3 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -45,7 +45,7 @@ export class UserController {
|
||||||
return await this.userService.getAllUsers(authUser, isAll);
|
return await this.userService.getAllUsers(authUser, isAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get('/:userId')
|
@Get('/info/:userId')
|
||||||
async getUserById(@Param('userId') userId: string): Promise<UserResponseDto> {
|
async getUserById(@Param('userId') userId: string): Promise<UserResponseDto> {
|
||||||
return await this.userService.getUserById(userId);
|
return await this.userService.getUserById(userId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ export class UserService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserById(userId: string): Promise<UserResponseDto> {
|
async getUserById(userId: string): Promise<UserResponseDto> {
|
||||||
|
console.log(userId);
|
||||||
const user = await this.userRepository.get(userId);
|
const user = await this.userRepository.get(userId);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
throw new NotFoundException('User not found');
|
throw new NotFoundException('User not found');
|
||||||
|
|
@ -46,6 +47,7 @@ export class UserService {
|
||||||
|
|
||||||
return mapUser(user);
|
return mapUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getUserInfo(authUser: AuthUserDto): Promise<UserResponseDto> {
|
async getUserInfo(authUser: AuthUserDto): Promise<UserResponseDto> {
|
||||||
const user = await this.userRepository.get(authUser.id);
|
const user = await this.userRepository.get(authUser.id);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -3623,7 +3623,7 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration)
|
||||||
getUserById: async (userId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
getUserById: async (userId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
// verify required parameter 'userId' is not null or undefined
|
// verify required parameter 'userId' is not null or undefined
|
||||||
assertParamExists('getUserById', 'userId', userId)
|
assertParamExists('getUserById', 'userId', userId)
|
||||||
const localVarPath = `/user/{userId}`
|
const localVarPath = `/user/info/{userId}`
|
||||||
.replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
|
.replace(`{${"userId"}}`, encodeURIComponent(String(userId)));
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue