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

fix: allow return 'data' as response prop #3876

Conversation

djabarovgeorge
Copy link
Contributor

What change does this PR introduce?

allow return 'data' as response prop

Why was this change needed?

so we could create entities with a 'data' prop on the root layer and return them properly.

Other information (Screenshots)

@@ -17,7 +17,7 @@ export class ResponseInterceptor<T> implements NestInterceptor<T, Response<T>> {
return next.handle().pipe(
map((data) => {
// For paginated results that already contain the data wrapper, return the whole object
if (data?.data) {
if (data?.data && !data?._id) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Amazing! Maybe worth adding a small comment here on why it's added like this here.

@djabarovgeorge djabarovgeorge merged commit 4a7999e into nv-2452-tenant-create-a-tenant-sidebar Jul 31, 2023
4 checks passed
@djabarovgeorge djabarovgeorge deleted the fix-response-interceptor-to-return-data-as-a-prop branch July 31, 2023 06:36
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