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

22 lines
465 B
TypeScript
Raw Normal View History

2021-05-08 00:21:58 +01:00
import { appendAPIURL, getHeaders } from "./apiUtils";
type MountsType = {
[key: string]: {
type: string
options: {
version: string
}
}
}
export async function getMounts(): Promise<MountsType> {
const request = new Request(appendAPIURL("/v1/sys/internal/ui/mounts"), {
headers: (getHeaders() as any),
});
return fetch(request).then(response => {
return response.json();
}).then(data => {
return data.data.secret;
});
}