Skip to content

Commit

Permalink
feat(core): add decorator for response http status 402 ApiPaymentRequ…
Browse files Browse the repository at this point in the history
…iredResponse
  • Loading branch information
Maelig committed Feb 6, 2024
1 parent 500a718 commit 68d2366
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 68d2366

Please sign in to comment.