Frontend: hardcoded /api/v1 paths bypass ZAMPP_API.fetch in upload module #115

Closed
opened 2026-05-26 18:20:46 -04:00 by zgaetano · 1 comment
Owner

Fixed in 04ce096. window.ZAMPP_API_PREFIX exposes /api/v1 from data.jsx. Upload XHRs (/part, /simple), SDK upload XHR, and thumbnail fetch in visuals.jsx all use it instead of hardcoding the prefix.

Fixed in 04ce096. `window.ZAMPP_API_PREFIX` exposes `/api/v1` from `data.jsx`. Upload XHRs (`/part`, `/simple`), SDK upload XHR, and thumbnail fetch in `visuals.jsx` all use it instead of hardcoding the prefix.
Author
Owner

Fix Plan — #115 Hardcoded /api/v1 paths in upload module

Root cause: screens-ingest.jsx:36,56_xhrPost uses literal /api/v1/upload/simple and /api/v1/upload/part. If API prefix changes, uploads silently break. Bypasses ZAMPP_API.fetch.

Fix — share API_BASE constant:

// data.jsx
export const API_BASE = "/api/v1";

// screens-ingest.jsx
import { API_BASE } from "./data.jsx";
const url = `${API_BASE}/upload/simple`;

Alternatively, expose ZAMPP_API.xhrPost() helper that wraps fetch with the correct base + error handling.

Files: screens-ingest.jsx:36,56, data.jsx
Effort: ~30min
**Priority: P2 — maintainability

## Fix Plan — #115 Hardcoded /api/v1 paths in upload module **Root cause:** `screens-ingest.jsx:36,56` — `_xhrPost` uses literal `/api/v1/upload/simple` and `/api/v1/upload/part`. If API prefix changes, uploads silently break. Bypasses `ZAMPP_API.fetch`. **Fix — share API_BASE constant:** ```js // data.jsx export const API_BASE = "/api/v1"; // screens-ingest.jsx import { API_BASE } from "./data.jsx"; const url = `${API_BASE}/upload/simple`; ``` Alternatively, expose `ZAMPP_API.xhrPost()` helper that wraps `fetch` with the correct base + error handling. **Files:** `screens-ingest.jsx:36,56`, `data.jsx` **Effort:** ~30min **Priority: P2 — maintainability
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: WildDragonLLC/dragonflight#115
No description provided.