LOW: Missing frontend API client for GET /api/news/:id and GET /api/pricing/:id endpoints #16

Closed
opened 2026-05-09 00:03:27 +00:00 by Mark · 1 comment
Owner

Severity: Low

Location

src/lib/api.ts lines 104–117

Description

The backend defines these endpoints:

  • GET /api/news/:id — get single news item
  • GET /api/pricing/:id — get single pricing entry

But the frontend API client only exposes:

  • pricingApi.getAll() — missing getById
  • newsApi.getAll() — missing getById

While the frontend currently doesn't use individual detail views, the endpoints exist but are unreachable from the frontend.

Impact

  • Incomplete API coverage in the frontend client
  • If detail views are added in the future, the API methods will need to be added

Suggested Fix

Add the missing methods:

export const pricingApi = {
  getAll: (): Promise<PricingEntry[]> => fetchApi('/pricing'),
  getById: (id: string): Promise<PricingEntry> => fetchApi(`/pricing/${id}`),
};

export const newsApi = {
  getAll: (): Promise<NewsItem[]> => fetchApi('/news'),
  getById: (id: string): Promise<NewsItem> => fetchApi(`/news/${id}`),
};

(Note: newsApi.getById is already missing from the current code; pricingApi.getById is also not exposed)

## Severity: Low ## Location `src/lib/api.ts` lines 104–117 ## Description The backend defines these endpoints: - `GET /api/news/:id` — get single news item - `GET /api/pricing/:id` — get single pricing entry But the frontend API client only exposes: - `pricingApi.getAll()` — missing `getById` - `newsApi.getAll()` — missing `getById` While the frontend currently doesn't use individual detail views, the endpoints exist but are unreachable from the frontend. ## Impact - Incomplete API coverage in the frontend client - If detail views are added in the future, the API methods will need to be added ## Suggested Fix Add the missing methods: ```typescript export const pricingApi = { getAll: (): Promise<PricingEntry[]> => fetchApi('/pricing'), getById: (id: string): Promise<PricingEntry> => fetchApi(`/pricing/${id}`), }; export const newsApi = { getAll: (): Promise<NewsItem[]> => fetchApi('/news'), getById: (id: string): Promise<NewsItem> => fetchApi(`/news/${id}`), }; ``` (Note: `newsApi.getById` is already missing from the current code; `pricingApi.getById` is also not exposed)
Author
Owner

GSD VERIFY phase failed after 3 attempts.
Conformance failure: Unexpected files modified: src/lib/api.ts; Expected files not modified: /home/b/Projects/subvault/src/lib/api.ts

GSD VERIFY phase failed after 3 attempts. Conformance failure: Unexpected files modified: src/lib/api.ts; Expected files not modified: /home/b/Projects/subvault/src/lib/api.ts
Mark 2026-05-26 08:12:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/subvault#16
No description provided.