From 7fb97448471b1eb062b84d1a00a2a543f9ddad1b Mon Sep 17 00:00:00 2001 From: flfeders Date: Tue, 8 Oct 2024 13:57:23 +0200 Subject: [PATCH] Cahnges --- composables/useSupabase.js | 11 +++++--- pages/profiles/show/[id].vue | 28 ++++++++++++++++++++ stores/data.js | 51 ++++++++++++++++++++++++++++-------- 3 files changed, 75 insertions(+), 15 deletions(-) diff --git a/composables/useSupabase.js b/composables/useSupabase.js index 61f6eb7..38820cd 100644 --- a/composables/useSupabase.js +++ b/composables/useSupabase.js @@ -11,7 +11,7 @@ export const useSupabaseSelect = async (relation,select = '*', sortColumn = null .from(relation) .select(select) .eq("tenant", dataStore.currentTenant) - .order(sortColumn, {ascending: true})).data + .order(sortColumn, {ascending: ascending})).data } else { data = (await supabase .from(relation) @@ -22,7 +22,7 @@ export const useSupabaseSelect = async (relation,select = '*', sortColumn = null return data } -export const useSupabaseSelectDocuments = async (select = '*', sortColumn = null) => { +export const useSupabaseSelectDocuments = async (select = '*', sortColumn = null, folderPath = "_") => { const supabase = useSupabaseClient() const dataStore = useDataStore() let data = null @@ -33,12 +33,15 @@ export const useSupabaseSelectDocuments = async (select = '*', sortColumn = null .from("documents") .select(select) .eq("tenant", dataStore.currentTenant) + .eq("folderPath", folderPath) .order(sortColumn, {ascending: true})).data } else { data = (await supabase .from("documents") .select(select) - .eq("tenant", dataStore.currentTenant)).data + .eq("tenant", dataStore.currentTenant) + .eq("folderPath",folderPath)).data + } if(data.length > 0){ @@ -60,7 +63,7 @@ export const useSupabaseSelectDocuments = async (select = '*', sortColumn = null } - console.log(data) + //console.log(data) return data } diff --git a/pages/profiles/show/[id].vue b/pages/profiles/show/[id].vue index d2cdc2f..644b7de 100644 --- a/pages/profiles/show/[id].vue +++ b/pages/profiles/show/[id].vue @@ -140,6 +140,24 @@ const saveSignature = async () => { contentSaved.value = true } } + + + +const addToNewsletter = async () => { + const {data,error} = await axios({ + url: "https://newsletter.fedeo.io/api/public/subscription", + method: "post", + data: { + email: dataStore.activeProfile.email, + name: dataStore.activeProfile.name, + list_uuids: ["b97453fd-14b2-4b25-8f9b-b83847317ea3"], + + } + }) + + console.log(data) +} +