fix(api): align frontend with project-scoped backend

Use project-scoped endpoints and run IDs for current project, SCADA metadata, historical time series, migrated DMA results, and sensor placement runs.

The regressions recurred because tests mocked pre-interceptor and new-only payload shapes, while history queries relied on implicit global scheme state and unbounded request fan-out. Cover post-interceptor pages, migrated result_rows, explicit run_id routing, multi-element requests, request limits, and cancellation.
This commit is contained in:
2026-09-01 14:37:51 +08:00
parent 0dad61ff1f
commit 29b8babd68
28 changed files with 1512 additions and 3494 deletions
+5 -2
View File
@@ -85,7 +85,7 @@ describe("ProjectProvider authentication boundary", () => {
expect(mockApiFetch).not.toHaveBeenCalled();
});
it("restores and opens a saved project after authentication", async () => {
it("restores a saved project and reads its current metadata", async () => {
seedSavedProject();
mockUseSession.mockReturnValue({ status: "authenticated" });
@@ -95,7 +95,10 @@ describe("ProjectProvider authentication boundary", () => {
</ProjectProvider>,
);
await waitFor(() => expect(mockApiFetch).toHaveBeenCalledTimes(2));
await waitFor(() => expect(mockApiFetch).toHaveBeenCalledTimes(1));
expect(mockApiFetch).toHaveBeenCalledWith(
"http://backend.test/api/v1/projects/current",
);
expect(mockSetCurrentProjectId).toHaveBeenCalledWith(
"a2d67c84-fd9d-4feb-a500-c357244b2760",
);