Add basic author form

This commit is contained in:
2025-11-25 14:14:24 +01:00
parent 3cbe9f909e
commit 624dfe0faa
10 changed files with 138 additions and 3 deletions

30
front/src/AuthorForm.vue Normal file
View File

@@ -0,0 +1,30 @@
<script setup>
import { ref } from 'vue'
import { getAuthor } from './api.js'
import { onBeforeRouteUpdate } from 'vue-router'
const props = defineProps({
id: String
});
let data = ref(null);
let error = ref(null);
getAuthor(data, error, props.id);
onBeforeRouteUpdate(async (to, from) => {
getAuthor(data, error, to.params.id);
})
</script>
<template>
<div v-if="error">{{$t('authorform.error', {err: error.message})}}</div>
<div v-if="data">
<h3 class="title">{{data.name}}</h3>
<p v-if="data.description">{{data.description}}</p>
</div>
</template>
<style scoped>
</style>