feat(web): add client-side routes for views
Deep-link, refresh and back/forward now land on the view the operator
was on instead of the board. Vanilla History API (pushState/popstate),
no router dependency: /library, /queues, /movies/{id}/releases and
/search?q= all restore on load.
Closes #102
This commit is contained in:
@@ -64,6 +64,19 @@ export async function searchTitles(query: string, signal: AbortSignal): Promise<
|
||||
}
|
||||
}
|
||||
|
||||
/** A single movie by id — used to restore the release deck from a URL alone. */
|
||||
export async function fetchMovie(movieId: number): Promise<LibraryMovie | null> {
|
||||
try {
|
||||
const response = await fetch(`/api/movies/${movieId}`);
|
||||
if (!response.ok) {
|
||||
return null;
|
||||
}
|
||||
return (await response.json()) as LibraryMovie;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
let rootsCache: Root[] | null = null;
|
||||
|
||||
/** Every root, fetched once. Audience chips resolve root ids through these. */
|
||||
|
||||
Reference in New Issue
Block a user