wip: Create some frontend components to test API generation
This commit is contained in:
parent
532d37ce81
commit
e91bf96e74
10 changed files with 138 additions and 6 deletions
34
frontend/src/pages/certificates/[fingerprint].vue
Normal file
34
frontend/src/pages/certificates/[fingerprint].vue
Normal file
|
@ -0,0 +1,34 @@
|
|||
<script setup lang="ts">
|
||||
|
||||
import { onMounted, ref } from "vue";
|
||||
import { fetchClient, type Schemas } from "@/plugins/client.ts";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const route = useRoute();
|
||||
const certificate = ref<Schemas["Certificate"] | null>(null);
|
||||
|
||||
async function getCertificate() {
|
||||
const fingerprint = route.params.fingerprint as string;
|
||||
const response = await fetchClient.GET("/api/certificates/{fingerprint}", {
|
||||
params: {
|
||||
path: {
|
||||
fingerprint,
|
||||
}
|
||||
}
|
||||
});
|
||||
certificate.value = response.data ?? null;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getCertificate()
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<form v-if="certificate">
|
||||
<h2>Details des Zertifikats: {{ certificate.fingerprint }}</h2>
|
||||
</form>
|
||||
</main>
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue