Skip to content

Commit 39a81c2

Browse files
committed
fix: new route for answer
1 parent d4af063 commit 39a81c2

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

src/db/db.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ function buildTypeOrmConfig(): DataSourceOptions {
88
return {
99
type: 'postgres',
1010
url: process.env.DB_URL,
11-
ssl: {
12-
rejectUnauthorized: false,
13-
},
1411
extra: {
1512
ssl: {
1613
rejectUnauthorized: false,

src/step/dto/response-step.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ApiProperty } from '@nestjs/swagger';
22
import { Expose } from 'class-transformer';
33
import { PerguntaResponseDto } from './response-pergunta.dto';
44

5-
export class StepResponseDto {
5+
export class AnswerStepResponseDto {
66
@Expose()
77
@ApiProperty({ example: 1, description: 'ID do step' })
88
id: number;

src/step/step.controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from '@nestjs/swagger';
1919
import { CreateStepDto } from './dto/create-step.dto';
2020
import { UpdateStepDto } from './dto/update-step.dto';
21-
import { StepResponseDto } from './dto/response-step.dto';
21+
import { AnswerStepResponseDto } from './dto/response-step.dto';
2222
import { StepSimpleResponseDto } from './dto/step-simple-response.dto';
2323
import { StepService } from './step.service';
2424
import { errorExamples } from '../common/swagger/error-examples';
@@ -51,7 +51,7 @@ export class StepController {
5151
summary: 'Buscar steps com perguntas de um edital específico',
5252
})
5353
@ApiOkResponse({
54-
type: [StepResponseDto],
54+
type: [AnswerStepResponseDto],
5555
description: 'Steps com perguntas encontrados com sucesso',
5656
})
5757
@ApiNotFoundResponse({
@@ -64,7 +64,7 @@ export class StepController {
6464
})
6565
async findStepsWithPerguntasByEdital(
6666
@Param('id', ParseIntPipe) id: number,
67-
): Promise<StepResponseDto[]> {
67+
): Promise<AnswerStepResponseDto[]> {
6868
return this.stepService.findStepsByEditalWithPerguntas(id);
6969
}
7070

src/step/step.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { InputFormatPlaceholders } from '../enum/enumInputFormat';
1212
import { CreateStepDto } from './dto/create-step.dto';
1313
import { UpdateStepDto } from './dto/update-step.dto';
1414
import { PerguntaResponseDto } from './dto/response-pergunta.dto';
15-
import { StepResponseDto } from './dto/response-step.dto';
15+
import {AnswerStepResponseDto } from './dto/response-step.dto';
1616
import { StepSimpleResponseDto } from './dto/step-simple-response.dto';
1717

1818
@Injectable()
@@ -25,7 +25,7 @@ export class StepService {
2525
) {}
2626

2727
// Buscar steps com perguntas de um edital específico
28-
async findStepsByEditalWithPerguntas(id: number): Promise<StepResponseDto[]> {
28+
async findStepsByEditalWithPerguntas(id: number): Promise<AnswerStepResponseDto[]> {
2929
try {
3030
const steps = await this.stepRepository.find({
3131
where: { edital: { id } },
@@ -40,7 +40,7 @@ export class StepService {
4040

4141
// Transform steps and their perguntas
4242
return steps.map((step) => {
43-
const transformedStep = plainToInstance(StepResponseDto, step, {
43+
const transformedStep = plainToInstance(AnswerStepResponseDto, step, {
4444
excludeExtraneousValues: true,
4545
});
4646

@@ -182,7 +182,7 @@ export class StepService {
182182
}
183183

184184
// Manter compatibilidade com método antigo
185-
async findStepsByEdital_OLD(id: number): Promise<StepResponseDto[]> {
185+
async findStepsByEdital_OLD(id: number): Promise<AnswerStepResponseDto[]> {
186186
return this.findStepsByEditalWithPerguntas(id);
187187
}
188188
}

0 commit comments

Comments
 (0)