fix(ui): различать снимок историю и неизвестный каталог пользователей
This commit is contained in:
1 parent
c37498512f
commit
9320c11d58
10 files changed
+111
-52
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user