Commit 6e6f3bb
committed
feat: dynamic tier limit from backend instead of hardcoded constant (OPE-118)
New useUserUsage hook calls GET /api/v1/users/usage (React Query, 60s stale).
Returns actual max_functions_per_repo for the user's tier from backend.
DashboardHome now passes usage?.limits?.max_functions_per_repo to
DirectoryPicker instead of TIER_FUNCTION_LIMITS[userTier].
Removed: TIER_FUNCTION_LIMITS import, TierName import, rawTier/userTier
derivation from session metadata. All gone from DashboardHome.
If user is on Pro (20K limit), budget bar shows X/20,000.
If admin bumps them to Enterprise (500K), it updates on next page load.
No frontend deploy needed when tier limits change on backend.1 parent eabf178 commit 6e6f3bb
2 files changed
Lines changed: 24 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 26 | + | |
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
| |||
260 | 256 | | |
261 | 257 | | |
262 | 258 | | |
263 | | - | |
264 | | - | |
| 259 | + | |
265 | 260 | | |
266 | 261 | | |
267 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
0 commit comments