mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 09:15:34 +03:00
chore(server): remove user count endpoint (#4724)
* chore: remove unused endpoint * chore: open api
This commit is contained in:
@@ -14,15 +14,8 @@ import {
|
||||
IUserRepository,
|
||||
} from '../repositories';
|
||||
import { StorageCore, StorageFolder } from '../storage';
|
||||
import { CreateUserDto, UpdateUserDto, UserCountDto } from './dto';
|
||||
import {
|
||||
CreateProfileImageResponseDto,
|
||||
UserCountResponseDto,
|
||||
UserResponseDto,
|
||||
mapCreateProfileImageResponse,
|
||||
mapUser,
|
||||
mapUserCountResponse,
|
||||
} from './response-dto';
|
||||
import { CreateUserDto, UpdateUserDto } from './dto';
|
||||
import { CreateProfileImageResponseDto, UserResponseDto, mapCreateProfileImageResponse, mapUser } from './response-dto';
|
||||
import { UserCore } from './user.core';
|
||||
|
||||
@Injectable()
|
||||
@@ -64,16 +57,6 @@ export class UserService {
|
||||
return mapUser(user);
|
||||
}
|
||||
|
||||
async getCount(dto: UserCountDto): Promise<UserCountResponseDto> {
|
||||
let users = await this.userCore.getList();
|
||||
|
||||
if (dto.admin) {
|
||||
users = users.filter((user) => user.isAdmin);
|
||||
}
|
||||
|
||||
return mapUserCountResponse(users.length);
|
||||
}
|
||||
|
||||
async create(createUserDto: CreateUserDto): Promise<UserResponseDto> {
|
||||
const createdUser = await this.userCore.createUser(createUserDto);
|
||||
return mapUser(createdUser);
|
||||
|
||||
Reference in New Issue
Block a user