scaffolded apikey retrieval

This commit is contained in:
Christopher Bisset 2022-08-13 10:51:04 +10:00
parent ad9b840ddb
commit 98df17298f
2 changed files with 27 additions and 4 deletions

View file

@ -338,7 +338,7 @@
});
await apiKeysResponse.json().then((data) => {
apiKeys = data.preAuthKeys;
apiKeys = data.apiKeys;
});
return apiKeys;
}

View file

@ -1,4 +1,27 @@
<script lang="ts">
import { getAPIKeys } from '$lib/common/apiFunctions.svelte';
import { APIKey } from '$lib/common/classes';
import { alertStore } from '$lib/common/stores';
import { onMount } from 'svelte';
let keyList = [new APIKey()];
function getAPIKeysAction() {
getAPIKeys()
.then((keys) => {
keyList = keys;
console.log(keyList);
})
.catch((error) => {
$alertStore = error;
});
}
onMount(() => {
getAPIKeysAction();
});
</script>
<button type="button" class="tooltip" data-tip="stuff">
<!-- clock -->
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
</button>
<!-- clock -->
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
</button>