Fix #113
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -47,8 +47,7 @@ const links = computed(() => {
|
||||
id: 'historyitems',
|
||||
label: "Logbuch",
|
||||
to: "/historyitems",
|
||||
icon: "i-heroicons-book-open",
|
||||
disabled: true
|
||||
icon: "i-heroicons-book-open"
|
||||
},
|
||||
{
|
||||
label: "Organisation",
|
||||
|
||||
Reference in New Issue
Block a user