Created Service, Module and Controller for Formular and Field
This commit is contained in:
@@ -6,6 +6,11 @@ import { MercuriusDriver, MercuriusDriverConfig } from '@nestjs/mercurius';
|
||||
import { EventsModule } from './events/events.module';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { EventEntity } from './events/events.entity';
|
||||
import { FormularController } from './formular/formular.controller';
|
||||
import { FormularService } from './formular/formular.service';
|
||||
import { FieldsService } from './fields/fields.service';
|
||||
import { FormularModule } from './formular/formular.module';
|
||||
import { FieldsModule } from './fields/fields.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@@ -25,11 +30,13 @@ import { EventEntity } from './events/events.entity';
|
||||
synchronize: true,
|
||||
entities: [EventEntity]
|
||||
}),
|
||||
FormularModule,
|
||||
FieldsModule,
|
||||
|
||||
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService, AppController],
|
||||
controllers: [AppController, FormularController],
|
||||
providers: [AppService, AppController, FormularService, FieldsService],
|
||||
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
2
src/dto
2
src/dto
Submodule src/dto updated: 3798232611...d6ae29cd12
@@ -1,5 +1,4 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { MyEvent } from 'src/dto/event.dto';
|
||||
import { Repository } from 'typeorm';
|
||||
import { EventEntity } from './events.entity';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
18
src/fields/fields.controller.spec.ts
Normal file
18
src/fields/fields.controller.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { FieldsController } from './fields.controller';
|
||||
|
||||
describe('FieldsController', () => {
|
||||
let controller: FieldsController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [FieldsController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<FieldsController>(FieldsController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
4
src/fields/fields.controller.ts
Normal file
4
src/fields/fields.controller.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Controller } from '@nestjs/common';
|
||||
|
||||
@Controller('fields')
|
||||
export class FieldsController {}
|
||||
7
src/fields/fields.module.ts
Normal file
7
src/fields/fields.module.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { FieldsController } from './fields.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [FieldsController]
|
||||
})
|
||||
export class FieldsModule {}
|
||||
18
src/fields/fields.service.spec.ts
Normal file
18
src/fields/fields.service.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { FieldsService } from './fields.service';
|
||||
|
||||
describe('FieldsService', () => {
|
||||
let service: FieldsService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [FieldsService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<FieldsService>(FieldsService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
4
src/fields/fields.service.ts
Normal file
4
src/fields/fields.service.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class FieldsService {}
|
||||
18
src/formular/formular.controller.spec.ts
Normal file
18
src/formular/formular.controller.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { FormularController } from './formular.controller';
|
||||
|
||||
describe('FormularController', () => {
|
||||
let controller: FormularController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [FormularController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<FormularController>(FormularController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
6
src/formular/formular.controller.ts
Normal file
6
src/formular/formular.controller.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Controller } from '@nestjs/common';
|
||||
|
||||
@Controller('/api/formulare')
|
||||
export class FormularController {
|
||||
|
||||
}
|
||||
4
src/formular/formular.module.ts
Normal file
4
src/formular/formular.module.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
@Module({})
|
||||
export class FormularModule {}
|
||||
18
src/formular/formular.service.spec.ts
Normal file
18
src/formular/formular.service.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { FormularService } from './formular.service';
|
||||
|
||||
describe('FormularService', () => {
|
||||
let service: FormularService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [FormularService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<FormularService>(FormularService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
4
src/formular/formular.service.ts
Normal file
4
src/formular/formular.service.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class FormularService {}
|
||||
Reference in New Issue
Block a user