2022-02-03 10:06:44 -06:00
|
|
|
import { Injectable } from '@nestjs/common';
|
|
|
|
|
import { InjectRepository } from '@nestjs/typeorm';
|
2022-04-23 21:08:45 -05:00
|
|
|
import { Not, Repository } from 'typeorm';
|
|
|
|
|
import { AuthUserDto } from '../../decorators/auth-user.decorator';
|
2022-02-03 10:06:44 -06:00
|
|
|
import { CreateUserDto } from './dto/create-user.dto';
|
|
|
|
|
import { UpdateUserDto } from './dto/update-user.dto';
|
|
|
|
|
import { UserEntity } from './entities/user.entity';
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
|
export class UserService {
|
|
|
|
|
constructor(
|
|
|
|
|
@InjectRepository(UserEntity)
|
|
|
|
|
private userRepository: Repository<UserEntity>,
|
|
|
|
|
) {}
|
2022-04-23 21:08:45 -05:00
|
|
|
|
|
|
|
|
async getAllUsers(authUser: AuthUserDto) {
|
|
|
|
|
return await this.userRepository.find({
|
|
|
|
|
where: { id: Not(authUser.id) },
|
|
|
|
|
});
|
|
|
|
|
}
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|