Trần Viết Sơn
fix: refactor, add entities
c114c72
raw
history blame
633 Bytes
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`;
}
}