Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add api response custom decorator #3289

Merged
merged 3 commits into from
Apr 27, 2023
Merged

Conversation

jainpawan21
Copy link
Member

@jainpawan21 jainpawan21 commented Apr 25, 2023

What change does this PR introduce?

Add DataWrapperDto
Add ApiResponse custom decorator
Fix extra data field not showing in swagger
Add DataBooleanDto and DataNumberDto

Why was this change needed?

Other information (Screenshots)

Screenshot 2023-04-26 at 4 48 22 PM

Screenshot 2023-04-26 at 4 48 42 PM

@jainpawan21 jainpawan21 marked this pull request as ready for review April 26, 2023 11:16
@jainpawan21 jainpawan21 requested review from scopsy, p-fernandez and djabarovgeorge and removed request for p-fernandez April 26, 2023 11:19

export const ApiResponse = <DataDto extends Type<unknown>>(
dataDto: DataDto,
type: 200 | 201 = 200,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we call this statusCode, makes it easier to use from other files to understands what it is :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✅

Copy link
Contributor

@davidsoderberg davidsoderberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a small comment, but great work 🔥

@jainpawan21 jainpawan21 added this pull request to the merge queue Apr 27, 2023
Merged via the queue into next with commit 6021781 Apr 27, 2023
20 checks passed
@jainpawan21 jainpawan21 deleted the feature/data-wrapper-dto branch April 27, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants