wip: Start work on submitting the cert
This commit is contained in:
parent
651c205656
commit
22eae92cba
2 changed files with 48 additions and 45 deletions
|
@ -1,10 +1,26 @@
|
|||
<script setup lang="ts">
|
||||
import CertificateEditor from "@/components/CertificateEditor.vue";
|
||||
import { useMutation } from "@tanstack/vue-query";
|
||||
import { fetchClient } from "@/plugins/client.ts";
|
||||
|
||||
const submitNewCert = useMutation({
|
||||
mutationKey: ["submit-new-certificate"],
|
||||
mutationFn: async (certificate) => {
|
||||
fetchClient.POST("/api/certificates", {
|
||||
body: certificate,
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
function submitCertificate({ certificate }) {
|
||||
submitNewCert.mutate(certificate);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<v-container>
|
||||
<CertificateEditor />
|
||||
<CertificateEditor @submit="submitCertificate" :is-submitting="submitNewCert.isPending" />
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue