fix(ui): различать снимок историю и неизвестный каталог пользователей

This commit is contained in:
Denozordec committed 2026-10-01 10:18:42 +07:00
1 parent c37498512f
commit 9320c11d58
10 files changed
+111 -52

No files matched your search

+9
View File
@@ -1,4 +1,6 @@
import {
interfaceCatalogStateSchema,
type InterfaceCatalogState,
appUserReadSchema,
catalogInterfaceSchema,
userBindingSchema,
@@ -148,3 +150,10 @@ export function userApiError(error: unknown): string {
if (error instanceof Error) return error.message.length > 500 ? error.message.slice(0, 500) + "…" : error.message
return "Запрос не подтверждён."
}
export async function readInterfaceCatalogState(baseUrl: string, serverId: string, init?: RequestInit): Promise<InterfaceCatalogState> {
const raw = await requestJson<unknown>(baseUrl, "/api/users/interface-catalog-state?serverId=" + encodeURIComponent(serverId), init)
const state = interfaceCatalogStateSchema.parse(raw)
if (String(state.serverId) !== serverId) throw new Error("Не подтверждён сервер каталога интерфейсов.")
return state
}