web: make sure naming matches backend

This commit is contained in:
Jens Langhammer
2020-12-16 23:02:43 +01:00
parent 2d9efe035e
commit 3b7bba5a62
35 changed files with 64 additions and 62 deletions

11
web/src/api/Tokens.ts Normal file
View File

@ -0,0 +1,11 @@
import { DefaultClient } from "./Client";
interface TokenResponse {
key: string;
}
export function tokenByIdentifier(identifier: string): Promise<string> {
return DefaultClient.fetch<TokenResponse>(["core", "tokens", identifier, "view_key"]).then(
(r) => r.key
);
}