What β build the API base URL in one place instead of twenty-one.
Why β the identical ${protocol}://${host}:${port}/${base} expression is inlined 21 times across 9 files. If the URL shape ever changes, that is 21 edits and a near-certainty that one is missed.
Scope β export apiBase() from src/lib/services/config and adopt it everywhere. Verified counts on master:
| File |
Occurrences |
src/modules/auth/stores/auth.store.js |
11 |
src/modules/home/stores/home.store.js |
3 |
src/modules/admin/stores/admin.store.js |
1 |
src/modules/billing/stores/billing.store.js |
1 |
src/modules/invitations/stores/invitations.store.js |
1 |
src/modules/organizations/stores/organizations.store.js |
1 |
src/modules/tasks/stores/tasks.store.js |
1 |
src/modules/users/stores/users.store.js |
1 |
src/modules/docs/services/docs.service.js |
1 |
Note this is wider than a "stores" change β docs.service.js is not a store, and auth.store.js alone carries half the occurrences. Six of these files also define a local apiBase() wrapper; those go too.
Sequencing: blocked by #4515 β both edit admin.store.js and invitations.store.js. Land #4515 first, then rebase this one.
Definition of done: grep -rn 'api.protocol}://' src (excluding tests) returns nothing, grep -rn "const apiBase = () =>" src returns nothing, and the module suites pass.
Scope: validated 2026-07-28
Created via /dev:issue
Baseline: line numbers and counts here were verified against master @ d246bc14 (2026-07-28). Master moves β re-verify against current master before starting; the invariants above are what must hold regardless of where the code has drifted to.
What β build the API base URL in one place instead of twenty-one.
Why β the identical
${protocol}://${host}:${port}/${base}expression is inlined 21 times across 9 files. If the URL shape ever changes, that is 21 edits and a near-certainty that one is missed.Scope β export
apiBase()fromsrc/lib/services/configand adopt it everywhere. Verified counts on master:src/modules/auth/stores/auth.store.jssrc/modules/home/stores/home.store.jssrc/modules/admin/stores/admin.store.jssrc/modules/billing/stores/billing.store.jssrc/modules/invitations/stores/invitations.store.jssrc/modules/organizations/stores/organizations.store.jssrc/modules/tasks/stores/tasks.store.jssrc/modules/users/stores/users.store.jssrc/modules/docs/services/docs.service.jsNote this is wider than a "stores" change β
docs.service.jsis not a store, andauth.store.jsalone carries half the occurrences. Six of these files also define a localapiBase()wrapper; those go too.Sequencing: blocked by #4515 β both edit
admin.store.jsandinvitations.store.js. Land #4515 first, then rebase this one.Definition of done:
grep -rn 'api.protocol}://' src(excluding tests) returns nothing,grep -rn "const apiBase = () =>" srcreturns nothing, and the module suites pass.Scope: validated 2026-07-28
Created via /dev:issue
Baseline: line numbers and counts here were verified against
master @ d246bc14(2026-07-28). Master moves β re-verify against current master before starting; the invariants above are what must hold regardless of where the code has drifted to.