1
0
Fork 0
VaultUI/src/api/sys/getMounts.ts

22 lines
505 B
TypeScript

import { appendAPIURL, getHeaders } from "../apiUtils";
export type MountType = {
type: string;
options: {
version: string;
};
};
export type MountsType = {
[key: string]: MountType;
};
export async function getMounts(): Promise<MountsType> {
const request = new Request(appendAPIURL("/v1/sys/internal/ui/mounts"), {
headers: getHeaders(),
});
const resp = await fetch(request);
const data = (await resp.json()) as { data: { secret: MountsType } };
return data.data.secret;
}