File size: 633 Bytes
c114c72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Injectable } from '@nestjs/common';
import { CreateUserDto } from './dto/create-user.dto.js';
import { UserEntity } from '../../entities/user.entity.js';

@Injectable()
export class UserService {
  async create(createUserDto: CreateUserDto) {
    const user = await UserEntity.create({
      ...createUserDto,
    }).save();
    return 'This action adds a new user';
  }

  async findAll() {
    const users = await UserEntity.find();
    return users;
  }

  async findOne(id: string) {
    return `This action returns a #${id} user`;
  }

  async remove(id: number) {
    return `This action removes a #${id} user`;
  }
}