Commit 48ff163
authored
Fix/dashboard get data query engine (#230)
* Commit local controller changes
* fix: update controller logic
* Export getAllData function to fix failing tests
* Fix: Correct getAllData function to properly initialize getCompiledModel with required parameters
- Add collection config lookup before calling getCompiledModel
- Pass all 4 required parameters: connection, collectionConfig, projectId, isExternal
- Handle collection not found error properly
- Fixes TypeError: getAllData is not a function in tests
* Fix test mocks to properly support getAllData function calls
- Update getCompiledModel mock to accept connection, collectionConfig, projectId, isExternal params
- Make mock return a model object with find() method immediately (synchronously)
- Ensure QueryEngine is properly constructed with query parameter
* Refactor getAllData to properly handle QueryEngine and fix test compatibility
- Move QueryEngine operations into try-catch to handle validation errors with statusCode
- Ensure engine variable is accessible after filter/sort/populate operations
- Fix variable scope issue where engine was not accessible for count() call
* fix(dashboard-api): add limitFields, populate, cursor pagination, count and structured response to getData
* chore: remove local test script test-getData.js
* fix: add limitFields() to QueryEngine mock and controller chain
* fix: normalize getData errors and fix per-project log aggregation
* fix: address coderabbit and reviewer comments - restore jsdocs, fix password bypass, reorder populate before limitFields
* fix: normalize getData error responses to standard contract
* fix: normalize getData error responses to standard contract
* fix: reorder populate before limitFields, use topN for log aggregation, remove duplicate comment
* chore: resolve package-lock.json merge conflict
* fix: fix syntax error in log aggregation pipeline
* fix: remove stray brace causing syntax error in log aggregation
* ci: trigger rerun
* fix: fix unclosed template literal and missing closing brace in getData1 parent 53c9e9a commit 48ff163
3 files changed
Lines changed: 41 additions & 28 deletions
File tree
- apps
- dashboard-api/src/controllers
- public-api/src
- __tests__
- controllers
Lines changed: 31 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
342 | 353 | | |
343 | 354 | | |
344 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
345 | 358 | | |
346 | 359 | | |
347 | 360 | | |
| |||
395 | 408 | | |
396 | 409 | | |
397 | 410 | | |
398 | | - | |
399 | | - | |
| 411 | + | |
400 | 412 | | |
401 | 413 | | |
402 | 414 | | |
| |||
763 | 775 | | |
764 | 776 | | |
765 | 777 | | |
766 | | - | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
767 | 781 | | |
768 | 782 | | |
769 | 783 | | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
| 784 | + | |
774 | 785 | | |
775 | 786 | | |
776 | 787 | | |
| |||
850 | 861 | | |
851 | 862 | | |
852 | 863 | | |
853 | | - | |
| 864 | + | |
| 865 | + | |
854 | 866 | | |
855 | 867 | | |
856 | | - | |
| 868 | + | |
857 | 869 | | |
858 | 870 | | |
859 | 871 | | |
| |||
925 | 937 | | |
926 | 938 | | |
927 | 939 | | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
| 940 | + | |
| 941 | + | |
932 | 942 | | |
933 | 943 | | |
934 | 944 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
222 | 228 | | |
223 | 229 | | |
224 | 230 | | |
| |||
264 | 270 | | |
265 | 271 | | |
266 | 272 | | |
267 | | - | |
268 | 273 | | |
269 | 274 | | |
270 | 275 | | |
| |||
274 | 279 | | |
275 | 280 | | |
276 | 281 | | |
277 | | - | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
327 | 331 | | |
328 | 332 | | |
329 | 333 | | |
330 | | - | |
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
| |||
737 | 740 | | |
738 | 741 | | |
739 | 742 | | |
740 | | - | |
| 743 | + | |
0 commit comments