create user
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { ConfigurableController } from './configurable.controller';
|
||||
import { ConfigurableService } from './configurable.service';
|
||||
import { RoleService } from './roles.service';
|
||||
|
||||
describe('ConfigurableController', () => {
|
||||
let controller: ConfigurableController;
|
||||
@@ -8,7 +8,7 @@ describe('ConfigurableController', () => {
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [ConfigurableController],
|
||||
providers: [ConfigurableService],
|
||||
providers: [RoleService],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<ConfigurableController>(ConfigurableController);
|
||||
|
||||
@@ -9,14 +9,14 @@ import {
|
||||
ParseUUIDPipe,
|
||||
HttpStatus, Query,
|
||||
} from '@nestjs/common';
|
||||
import { ConfigurableService } from './configurable.service';
|
||||
import { RoleService } from './roles.service';
|
||||
|
||||
@Controller({
|
||||
path: 'config',
|
||||
version: '1',
|
||||
})
|
||||
export class ConfigurableController {
|
||||
constructor(private readonly usersService: ConfigurableService) {}
|
||||
constructor(private readonly usersService: RoleService) {}
|
||||
|
||||
@Get()
|
||||
async findAll(@Query('page') page: number) {
|
||||
|
||||
@@ -2,11 +2,12 @@ import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { Roles } from './entities/roles.entity';
|
||||
import { ConfigurableController } from './configurable.controller';
|
||||
import { ConfigurableService } from './configurable.service';
|
||||
import { RoleService } from './roles.service';
|
||||
|
||||
@Module({
|
||||
imports: [TypeOrmModule.forFeature([Roles])],
|
||||
controllers: [ConfigurableController],
|
||||
providers: [ConfigurableService],
|
||||
providers: [RoleService],
|
||||
exports: [RoleService]
|
||||
})
|
||||
export class ConfigurableModule {}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { ConfigurableService } from './configurable.service';
|
||||
import { RoleService } from './roles.service';
|
||||
|
||||
describe('ConfigurableService', () => {
|
||||
let service: ConfigurableService;
|
||||
describe('RoleService', () => {
|
||||
let service: RoleService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [ConfigurableService],
|
||||
providers: [RoleService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<ConfigurableService>(ConfigurableService);
|
||||
service = module.get<RoleService>(RoleService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Roles } from './entities/roles.entity';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
@Injectable()
|
||||
export class ConfigurableService {
|
||||
export class RoleService {
|
||||
constructor(
|
||||
@InjectRepository(Roles)
|
||||
private rolesRepository: Repository<Roles>,
|
||||
Reference in New Issue
Block a user