Commit 862d2ec
fix(admin): subscriptions page hid all subs; transactions leaked i18n key (#307)
Two defects surfaced while QA-testing admin analytics (#289).
Subscriptions list (`/dashboard/admin/subscriptions`):
- The PostgREST embed selected `plans(... duration_type)`, but `plans` has
no `duration_type` column (it's `duration_in_days`). The whole query
errored with `42703 column plans_1.duration_type does not exist`, the
error was swallowed, `subscriptions` came back null, and the page showed
"0 active / No subscriptions yet" — hiding every real subscription.
- Switch the select to `duration_in_days` and render a period label
(month / year / N days) instead of the missing `duration_type`.
- Drop a stray double colon in the Renews/Ended label (keys already end
with `:`).
Transactions table (`/dashboard/admin/transactions`):
- Payment method used `t(\`table.methods.${pm}\`) || pm`, but next-intl
returns the full key PATH on a miss (truthy), so the `|| pm` fallback was
dead code. Free-form methods like "manual - Bank Transfer" leaked
`dashboard.admin.transactions.table.methods.manual - Bank Transfer` into
the UI. Guard with `t.has()` and fall back to the raw value.
Adds en/es keys: subscriptions.table.perMonth/perYear/perDays.
Note: the unused `getSubscriptionDetails()` action carries the same
`duration_type` reference (plus a non-existent `profiles.email`); left as-is
since it's dead code, but it must be corrected before it's ever wired up.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent e2e7d84 commit 862d2ec
5 files changed
Lines changed: 22 additions & 4 deletions
File tree
- app/[locale]/dashboard/admin
- subscriptions
- transactions
- docs/screenshots
- messages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
| |||
77 | 85 | | |
78 | 86 | | |
79 | 87 | | |
80 | | - | |
| 88 | + | |
81 | 89 | | |
82 | 90 | | |
83 | 91 | | |
| |||
306 | 314 | | |
307 | 315 | | |
308 | 316 | | |
309 | | - | |
| 317 | + | |
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
| |||
316 | 324 | | |
317 | 325 | | |
318 | 326 | | |
319 | | - | |
| 327 | + | |
320 | 328 | | |
321 | 329 | | |
322 | 330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
210 | 214 | | |
211 | 215 | | |
212 | 216 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1963 | 1963 | | |
1964 | 1964 | | |
1965 | 1965 | | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
1966 | 1969 | | |
1967 | 1970 | | |
1968 | 1971 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1959 | 1959 | | |
1960 | 1960 | | |
1961 | 1961 | | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
1962 | 1965 | | |
1963 | 1966 | | |
1964 | 1967 | | |
| |||
0 commit comments