Skip to content

Commit 68d2366

Browse files
author
Maelig
committedFeb 6, 2024
feat(core): add decorator for response http status 402 ApiPaymentRequiredResponse
1 parent 500a718 commit 68d2366

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
 

‎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,

‎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.