Commit afee8e6
authored
feat: lazy load discord groups page (#2291)
* feat: added pagination for lazy loading in the /groups route to load the discord groups asynchrounously instead of all at once
* feat: Implement pagination for lazy loading in
- Added feature-flag-based () lazy loading to .
- Introduced support for , , and __TEXT __DATA __OBJC others dec hex query parameters for pagination.
- Validated query parameters and returned structured pagination metadata (, __TEXT __DATA __OBJC others dec hex, , ).
- Updated response structure to include enriched group membership information.
- Modified test cases in :
- Added tests for cursor-based lazy loading behavior.
- Handled scenarios with and without cursors.
- Verified error handling for database query failures.
* fix: test cases
* fix: correct paginated group roles endpoint and dynamic link generation
- Fixed incorrect and link generation in the endpoint.
- Ensured dynamically includes the correct path ().
- Dynamically constructed and links using and .
- Refactored function:
- Simplified conditional logic for feature flag.
- Added error handling for invalid page and size parameters.
- Removed hardcoding of URLs in response links to make them adaptive to the environment.
- Improved logging for easier debugging when issues arise.
- Added handling to ensure old behavior (non-dev mode) works as expected.
* chore remove test from here as moving tests in a different PR
* fix: failing tests1 parent 2ac202e commit afee8e6
File tree
4 files changed
+87
-10
lines changed- controllers
- middlewares/validators
- models
- routes
4 files changed
+87
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
125 | 126 | | |
126 | | - | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
130 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
131 | 157 | | |
| 158 | + | |
132 | 159 | | |
133 | 160 | | |
134 | 161 | | |
135 | 162 | | |
136 | 163 | | |
137 | | - | |
| 164 | + | |
138 | 165 | | |
139 | 166 | | |
140 | 167 | | |
141 | | - | |
142 | 168 | | |
143 | 169 | | |
144 | 170 | | |
| |||
534 | 560 | | |
535 | 561 | | |
536 | 562 | | |
537 | | - | |
| 563 | + | |
538 | 564 | | |
539 | 565 | | |
540 | 566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
42 | 63 | | |
43 | 64 | | |
44 | 65 | | |
45 | 66 | | |
| 67 | + | |
46 | 68 | | |
47 | 69 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
105 | 132 | | |
106 | 133 | | |
107 | 134 | | |
| |||
1085 | 1112 | | |
1086 | 1113 | | |
1087 | 1114 | | |
| 1115 | + | |
1088 | 1116 | | |
1089 | 1117 | | |
1090 | 1118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
0 commit comments