fix(lint): clean up type definitions and missing imports
Deploy Canina / deploy (push) Failing after 30m46s
Deploy Canina / deploy (push) Failing after 30m46s
This commit is contained in:
1 parent
9c8286c63f
commit
2de442dbae
9 files changed
+147
-62
No files matched your search
+13
-4
@@ -36,15 +36,21 @@ async function bootstrap() {
|
||||
forbidNonWhitelisted: true,
|
||||
exceptionFactory: (errors) => {
|
||||
const formattedDetails = errors.map((err) => {
|
||||
const constraints = err.constraints ? Object.values(err.constraints) : [];
|
||||
const constraints = err.constraints
|
||||
? Object.values(err.constraints)
|
||||
: [];
|
||||
return {
|
||||
field: err.property,
|
||||
message: constraints.length > 0 ? constraints[0] : 'مقدار وارد شده نامعتبر است.',
|
||||
message:
|
||||
constraints.length > 0
|
||||
? constraints[0]
|
||||
: 'مقدار وارد شده نامعتبر است.',
|
||||
};
|
||||
});
|
||||
|
||||
return new BadRequestException({
|
||||
message: 'اطلاعات ورودی فرم معتبر نمیباشد. لطفاً موارد مشخص شده را اصلاح نمایید.',
|
||||
message:
|
||||
'اطلاعات ورودی فرم معتبر نمیباشد. لطفاً موارد مشخص شده را اصلاح نمایید.',
|
||||
error: 'INVALID_INPUT_DATA',
|
||||
details: formattedDetails,
|
||||
});
|
||||
@@ -52,7 +58,10 @@ async function bootstrap() {
|
||||
}),
|
||||
);
|
||||
|
||||
app.useGlobalFilters(new CustomHttpExceptionFilter(), new PrismaExceptionFilter());
|
||||
app.useGlobalFilters(
|
||||
new CustomHttpExceptionFilter(),
|
||||
new PrismaExceptionFilter(),
|
||||
);
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Canina Iran API')
|
||||
|
||||
Reference in new issue
Block a user