This commit is contained in:
2026-02-21 22:17:58 +01:00
parent 409db82368
commit f5253b29f4
3 changed files with 51 additions and 10 deletions

View File

@@ -3,11 +3,13 @@ import dayjs from "dayjs"
const props = defineProps({
type: {
type: String,
required: true
required: false,
default: null
},
elementId: {
type: String,
required: true
required: false,
default: null
},
renderHeadline: {
type: Boolean,
@@ -25,13 +27,11 @@ const items = ref([])
const platform = ref("default")
const setup = async () => {
if(props.type && props.elementId){
items.value = await useNuxtApp().$api(`/api/resource/${props.type}/${props.elementId}/history`)
} /*else {
}*/
} else {
items.value = await useNuxtApp().$api(`/api/history`)
}
}
setup()
@@ -43,6 +43,10 @@ const addHistoryItemData = ref({
})
const addHistoryItem = async () => {
if (!props.type || !props.elementId) {
toast.add({ title: "Im zentralen Logbuch können keine direkten Einträge erstellt werden." })
return
}
const res = await useNuxtApp().$api(`/api/resource/${props.type}/${props.elementId}/history`, {
method: "POST",
@@ -161,4 +165,4 @@ const renderText = (text) => {
<style scoped>
</style>
</style>