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

@@ -1,5 +1,6 @@
<script setup>
const dataStore = useDataStore()
const profileStore = useProfileStore()
const router = useRouter()
@@ -35,7 +36,7 @@
</UDashboardNavbar>
<UTable
:rows="dataStore.profiles"
:rows="profileStore.profiles"
@select="(item) => router.push(`/profiles/show/${item.id}`)"
:columns="columns"
>

View File

@@ -12,6 +12,7 @@ dayjs.extend(isoWeek)
dayjs.extend(isBetween)
const dataStore = useDataStore()
const profileStore = useProfileStore()
const route = useRoute()
const router = useRouter()
const supabase = useSupabaseClient()
@@ -33,7 +34,7 @@ const setupPage = async () => {
setupPage()
const emailSignature = ref(dataStore.activeProfile.emailSignature)
const emailSignature = ref(profileStore.activeProfile.emailSignature)
const tiptapLoaded = ref(false)
const contentSaved = ref(true)
const contentChanged = async (content) => {
@@ -49,7 +50,7 @@ const contentChanged = async (content) => {
const saveSignature = async () => {
const {data,error} = await supabase.from("profiles").update({emailSignature: emailSignature.value}).eq("id", dataStore.activeProfile.id)
const {data,error} = await supabase.from("profiles").update({emailSignature: emailSignature.value}).eq("id", profileStore.activeProfile.id)
if(error) {
toast.add({title: "Fehler beim Speichern der Signatur", color:"rose"})
@@ -66,8 +67,8 @@ const addToNewsletter = async () => {
url: "https://newsletter.fedeo.io/api/public/subscription",
method: "post",
data: {
email: dataStore.activeProfile.email,
name: dataStore.activeProfile.name,
email: profileStore.activeProfile.email,
name: profileStore.activeProfile.name,
list_uuids: ["b97453fd-14b2-4b25-8f9b-b83847317ea3"],
}
@@ -227,12 +228,12 @@ const isLight = computed({
</UFormGroup>
</InputGroup>
<UDivider class="my-5" v-if="dataStore.activeProfile.id === itemInfo.id">
<UDivider class="my-5" v-if="profileStore.activeProfile.id === itemInfo.id">
Helligkeitseinstellung
</UDivider>
<UButton
v-if="dataStore.activeProfile.id === itemInfo.id"
v-if="profileStore.activeProfile.id === itemInfo.id"
:icon="isLight ? 'i-heroicons-moon-20-solid' : 'i-heroicons-sun-20-solid'"
color="white"
variant="outline"