Skip to content

Commit

Permalink
Merge pull request #2820 from mgohin/feature/add-decorator-ApiPayment…
Browse files Browse the repository at this point in the history
…RequiredResponse

feat(core): add decorator for reponse http status 402 : ApiPaymentRequiredResponse
  • Loading branch information
kamilmysliwiec authored Feb 7, 2024
2 parents 876d17a + 68d2366 commit 8ed4884
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/decorators/api-response.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ export const ApiPayloadTooLargeResponse = (options: ApiResponseOptions = {}) =>
status: HttpStatus.PAYLOAD_TOO_LARGE
});

export const ApiPaymentRequiredResponse = (options: ApiResponseOptions = {}) =>
ApiResponse({
...options,
status: HttpStatus.PAYMENT_REQUIRED
});

export const ApiRequestTimeoutResponse = (options: ApiResponseOptions = {}) =>
ApiResponse({
...options,
Expand Down
3 changes: 3 additions & 0 deletions lib/extra/swagger-shim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ export function ApiPreconditionFailedResponse() {
export function ApiPayloadTooLargeResponse() {
return () => {};
}
export function ApiPaymentRequiredResponse() {
return () => {};
}
export function ApiRequestTimeoutResponse() {
return () => {};
}
Expand Down

0 comments on commit 8ed4884

Please sign in to comment.