Repository navigation
Description
What happens
GET /v1/profiles/employers/unicorn
{"error":"Internal Server Error","message":"Could not find the table 'core.employers' in the schema cache"}
Verified against a live local stack. The route has never returned a response.
Why it cannot be a one-line fix
There is no employers table in any schema:
select table_schema||'.'||table_name
from information_schema.tables where table_name ilike '%employer%';
-- (0 rows)
select count(*) from information_schema.columns
where table_schema='core' and column_name='employer_id';
-- 0The handler also counts jobs with .eq("employer_id", employer.id) — a column that exists nowhere in core. The whole route was written against a schema that does not exist, not against one that drifted.
employer in this product is an organization: core.organizations carries owner_user_id, and core.jobs.organization_id is the real FK. GET /v1/profiles/organizations/{slug} already does what this route appears to want, and was repaired in #617 (its select had the same class of problem — five nonexistent columns).
No consumer
client.profiles.getEmployer(slug) is called once, from inside packages/scf-core/utils/profiles-sdk-hooks.ts. The hook it backs — useEmployerProfile — is imported by nothing outside that file (excluding dist/, tests and barrel re-exports).
The decision this needs
Not "make it work" — which behaviour is wanted:
- Delete the route, the SDK method and the hook.
GET /v1/profiles/organizations/{slug}already covers it and now works. This is the recommendation: there is no product behind the endpoint. - Make it an alias of the organizations route, if
employers/{slug}is a URL someone external depends on.
Either way KNOWN_GAPS and the SDK surface should end up consistent with the choice.
Acceptance
-
GET /v1/profiles/employers/{slug}either returns 200 with a real body or is gone from the API, the SDK and the hooks - No route in
profiles.tsreferencescore.employersoremployer_id - If deleted:
useEmployerProfile,profiles.getEmployerand theEmployerProfiletype go with it - The
profiles.test.tscases for/v1/profiles/employers/:slugare updated or removed to match
Found while working the /v1/organizations cluster of #447.
Activity
test(api): fail when a route reads a table that does not exist
test(api): fail when a route reads a table that does not exist (#651)
feat(profiles)!: drop getEmployer — it targeted a table that exists i…
feat(profiles)!: delete the employers route, which addressed a table …
feat(profiles)!: delete the employers route, which addressed a table …
feat(api)!: delete the employers route, and move user_feedback so /v1…