-
Notifications
You must be signed in to change notification settings - Fork 24
Modify getRollups API to use getRollup instead of search API #150
Conversation
Test Suites: 32 passed, 32 total |
server/services/RollupService.ts
Outdated
}); | ||
return response.custom({ | ||
statusCode: 200, | ||
body: { ok: true, response: { rollups: rollups, totalRollups: totalRollups, metadata: explainResponse } }, | ||
body: { ok: true, response: { rollups: rollups, total_rollups: totalRollups, metadata: explainResponse } }, |
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.
Any reason for changing this to snake_case?
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.
It was a few changes after adding type definition of GetRollupsResponse
in line 293, the interface definition was changed to snake_case, too.
Since other functions does not define the type of received response, had just removed the type definition in line 292 making it const getRollupResponse = await ...
and changed snake_case back to camelCase.
Issue #, if available: N/A
Description of changes:
Add new route
getRollups
inismPlugins.ts
Change
totalRollup
tototal_rollups
ingetRollupsResponse
interface to match with backend response.Previously
getRollups
is using search API to fetch multiple rollup jobs. Now changed to usegetRollup
and passing in parameters:from
,size
,search
,sortField
, andsortDirection
.Modify
getRollups
to fetch metadata of all rollup jobs by directly requesting fromism.explainRollup
, and removed previously defined functionexplainRollup
.A few updates on interface definitions to reduce mismatch type errors
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.