Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ async function bootstrap(): Promise<void> {
next();
}
});
app.useGlobalPipes(new ValidationPipe());
app.useGlobalPipes(
new ValidationPipe({
transform: true,
}),
);
app.useGlobalFilters(new HttpExceptionFilter(new JsendFormatter()));
// TODO: Update origin as needed
app.enableCors({ origin: '*', credentials: true });
Expand Down
4 changes: 1 addition & 3 deletions apps/api/src/modules/summary/dto/create-summary.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { InputType, Field } from '@nestjs/graphql';
import { IsOptional } from 'class-validator';
import { Stream } from 'stream';
import GraphQLUpload = require('graphql-upload/GraphQLUpload.js');
export interface FileUpload {
Expand All @@ -12,6 +11,5 @@ export interface FileUpload {
@InputType()
export class CreateSummaryDTO {
@Field(() => GraphQLUpload)
@IsOptional()
inputFile?: Promise<FileUpload>;
inputFile: Promise<FileUpload>;
}
Loading