Skip to content

Commit

Permalink
fix: add form data api decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoGathK committed Aug 31, 2022
1 parent 7a2dd11 commit bef2bf2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/decorator.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { Type, applyDecorators } from '@vodyani/core';
import { ApiOkResponse, getSchemaPath } from '@nestjs/swagger';
import { ApiBody, ApiConsumes, ApiOkResponse, getSchemaPath } from '@nestjs/swagger';

import { ExtraModelStore } from './struct';

export function SwaggerEntity(target: any) {
ExtraModelStore.set(target?.name, target);
}

export function ApiFormData(options: any) {
return applyDecorators(
ApiConsumes('multipart/form-data'),
ApiBody(options),
);
}

export function getResponseVo<T = any>(ResponseBodyVo: Type<T>) {
return function(Vo?: Type<T>) {
return applyDecorators(
Expand Down

0 comments on commit bef2bf2

Please sign in to comment.