Fix some final issues

Signed-off-by: ivgo <ivgo@spreadgroup.com>
This commit is contained in:
ivgo
2022-06-03 15:57:20 +02:00
parent ee04412ef2
commit d331cecc2e
4 changed files with 19 additions and 21 deletions
+9 -11
View File
@@ -85,18 +85,16 @@ export class VaultClient implements VaultApi {
query: { [key in string]: any },
method: string = 'GET',
): Promise<T | undefined> {
const response = await fetch(
`${this.vaultConfig.baseUrl}/${path}?${new URLSearchParams(
query,
).toString()}`,
{
method,
headers: {
Accept: 'application/json',
'X-Vault-Token': this.vaultConfig.token,
},
const url = `${this.vaultConfig.baseUrl}/${path}?${new URLSearchParams(
query,
).toString()}`;
const response = await fetch(url, {
method,
headers: {
Accept: 'application/json',
'X-Vault-Token': this.vaultConfig.token,
},
);
});
if (response.status === 200) {
return (await response.json()) as T;
}