-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: provide support for groupby #10277
base: master
Are you sure you want to change the base?
Conversation
5154497
to
05ea0ec
Compare
69e9545
to
24cce3f
Compare
d067241
to
e0a6d93
Compare
packages/rest/src/writer.ts
Outdated
@@ -50,8 +50,42 @@ export function writeResultToResponse( | |||
// TODO(ritch) remove this, should be configurable | |||
// See https://github.com/loopbackio/loopback-next/issues/436 | |||
response.setHeader('Content-Type', 'application/json'); | |||
// let customResult = result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this commented ? can you check please ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mistake. I'd fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not able to figure out what will the type returned for this method. groupBy is tricky because it can't return model array anymore so it will fail typings. Also I dont see repository related changes. Can you please add an end to end test here to confirm, its working end to end with repository ?
b721132
to
d344824
Compare
Signed-off-by: Muhammad Aaqil <[email protected]>
d344824
to
834539b
Compare
Signed-off-by: Muhammad Aaqil <[email protected]>
Hi, @samarpanB. The returned response of a group by filter should be an array of the models. I have added a test in one of the examples (todo-list). But the test fails due to missing changes from this and this PR. The test works fine locally if the changes are there from these PRs. |
Currently, loopback 4 doesn't support Groupby. This PR provides support for that.
Related PRs:
Checklist
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated👉 Check out how to submit a PR 👈