Introduced ProfileStore

Corrected All Links to DataStore
This commit is contained in:
2024-12-21 22:33:42 +01:00
parent 813944fc23
commit b465f4a75a
64 changed files with 508 additions and 959 deletions

View File

@@ -14,7 +14,7 @@ const props = defineProps({
}
})
const { metaSymbol } = useShortcuts()
const dataStore = useDataStore()
const profileStore = useProfileStore()
const user = useSupabaseUser()
const supabase = useSupabaseClient()
const toast = useToast()
@@ -79,13 +79,13 @@ const addHistoryItemData = ref({
const addHistoryItem = async () => {
console.log(addHistoryItemData.value)
addHistoryItemData.value.createdBy = dataStore.activeProfile.id
addHistoryItemData.value.createdBy = profileStore.activeProfile.id
addHistoryItemData.value[type] = elementId
const {data,error} = await supabase
.from("historyitems")
.insert([{...addHistoryItemData.value, tenant: dataStore.currentTenant}])
.insert([{...addHistoryItemData.value, tenant: profileStore.currentTenant}])
.select()
if(error) {
@@ -100,9 +100,9 @@ const addHistoryItem = async () => {
let rawUsername = i[1]
return {
tenant: dataStore.currentTenant,
tenant: profileStore.currentTenant,
profile: profiles.find(x => x.username === rawUsername).id,
initiatingProfile: dataStore.activeProfile.id,
initiatingProfile: profileStore.activeProfile.id,
title: "Sie wurden im Logbuch erwähnt",
link: `/${type}s/show/${elementId}`,
message: addHistoryItemData.value.text
@@ -198,11 +198,11 @@ const renderText = (text) => {
:src="colorMode.value === 'light' ? '/Logo.png' : '/Logo_Dark.png' "
/>
<UAvatar
:alt="dataStore.getProfileById(item.createdBy).fullName"
:alt="profileStore.getProfileById(item.createdBy).fullName"
v-else
/>
<div>
<h3 v-if="item.createdBy">{{dataStore.getProfileById(item.createdBy) ? dataStore.getProfileById(item.createdBy).fullName : ""}}</h3>
<h3 v-if="item.createdBy">{{profileStore.getProfileById(item.createdBy) ? profileStore.getProfileById(item.createdBy).fullName : ""}}</h3>
<h3 v-else>FEDEO Bot</h3>
<span v-html="renderText(item.text)"/><br>
<span class="text-gray-500">{{dayjs(item.created_at).format("DD.MM.YY HH:mm")}}</span>