Skip to content

Commit 8ed4884

Browse files
authoredFeb 7, 2024
Merge pull request #2820 from mgohin/feature/add-decorator-ApiPaymentRequiredResponse
feat(core): add decorator for reponse http status 402 : ApiPaymentRequiredResponse
2 parents 876d17a + 68d2366 commit 8ed4884

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
 

Diff for: ‎lib/decorators/api-response.decorator.ts

+6
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ export const ApiPayloadTooLargeResponse = (options: ApiResponseOptions = {}) =>
211211
status: HttpStatus.PAYLOAD_TOO_LARGE
212212
});
213213

214+
export const ApiPaymentRequiredResponse = (options: ApiResponseOptions = {}) =>
215+
ApiResponse({
216+
...options,
217+
status: HttpStatus.PAYMENT_REQUIRED
218+
});
219+
214220
export const ApiRequestTimeoutResponse = (options: ApiResponseOptions = {}) =>
215221
ApiResponse({
216222
...options,

Diff for: ‎lib/extra/swagger-shim.ts

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ export function ApiPreconditionFailedResponse() {
122122
export function ApiPayloadTooLargeResponse() {
123123
return () => {};
124124
}
125+
export function ApiPaymentRequiredResponse() {
126+
return () => {};
127+
}
125128
export function ApiRequestTimeoutResponse() {
126129
return () => {};
127130
}

0 commit comments

Comments
 (0)
Please sign in to comment.