feat: backend API NestJS + Prisma + JWT auth + todos los módulos
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { ProfessionsService } from './professions.service';
|
||||
|
||||
@ApiTags('Professions')
|
||||
@Controller('professions')
|
||||
export class ProfessionsController {
|
||||
constructor(private professions: ProfessionsService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.professions.findAll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ProfessionsService } from './professions.service';
|
||||
import { ProfessionsController } from './professions.controller';
|
||||
|
||||
@Module({
|
||||
providers: [ProfessionsService],
|
||||
controllers: [ProfessionsController],
|
||||
})
|
||||
export class ProfessionsModule {}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
export class ProfessionsService {
|
||||
constructor(private prisma: PrismaService) {}
|
||||
|
||||
findAll() {
|
||||
return this.prisma.professions.findMany({ orderBy: { name: 'asc' } });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user