11import { applyDecorators , Type } from '@nestjs/common' ;
2- import { ApiBody , ApiBodyOptions , ApiConsumes , ApiExtraModels , ApiOperationOptions , getSchemaPath } from '@nestjs/swagger' ;
2+ import {
3+ ApiBody ,
4+ ApiBodyOptions ,
5+ ApiConsumes ,
6+ ApiExtraModels ,
7+ ApiOperationOptions ,
8+ getSchemaPath ,
9+ } from '@nestjs/swagger' ;
310import { ApiResponseOptions } from '@nestjs/swagger/dist/decorators/api-response.decorator' ;
411import { ApiBodyDecorator } from '~/_common/decorators/api-body.decorator' ;
512import { ApiCreatedResponseDecorator } from '~/_common/decorators/api-created-response.decorator' ;
@@ -9,10 +16,10 @@ export const ApiFileUploadDecorator = <TModel extends Type<NonNullable<unknown>>
916 bodyModel : TModel ,
1017 responseModel : TModel ,
1118 options ?: {
12- bodyOptions ?: ApiBodyOptions | null | undefined ,
13- responseOptions ?: ApiResponseOptions | null | undefined ,
14- operationOptions ?: ApiOperationOptions | null | undefined ,
15- consumesOptions ?: string [ ] ,
19+ bodyOptions ?: ApiBodyOptions | null | undefined ;
20+ responseOptions ?: ApiResponseOptions | null | undefined ;
21+ operationOptions ?: ApiOperationOptions | null | undefined ;
22+ consumesOptions ?: string [ ] ;
1623 } ,
1724) => {
1825 const consumes = options ?. consumesOptions || [ 'multipart/form-data' ] ;
@@ -23,10 +30,7 @@ export const ApiFileUploadDecorator = <TModel extends Type<NonNullable<unknown>>
2330 ApiBody ( {
2431 schema : {
2532 type : 'object' ,
26- allOf : [
27- { $ref : getSchemaPath ( bodyModel ) } ,
28- { $ref : getSchemaPath ( uploadModel ) } ,
29- ] ,
33+ allOf : [ { $ref : getSchemaPath ( bodyModel ) } , { $ref : getSchemaPath ( uploadModel ) } ] ,
3034 // properties: {
3135 // // comment: { type: 'string' },
3236 // // outletId: { type: 'integer' },
@@ -37,7 +41,7 @@ export const ApiFileUploadDecorator = <TModel extends Type<NonNullable<unknown>>
3741 // },
3842 // },
3943 } ,
40- description : ' Corps de création de l\ 'enregistrement' ,
44+ description : " Corps de création de l'enregistrement" ,
4145 ...options ?. bodyOptions ,
4246 } ) ,
4347 ApiCreatedResponseDecorator ( responseModel , {
0 commit comments