Skip to content

Commit

Permalink
update filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyuujin committed Jul 11, 2024
1 parent ba08ee1 commit 0bc66c5
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions apps/web/app/composables/useSupabaseCsv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,40 @@ export function useSupabaseCsv() {
const client = useSupabaseClient<Database>()

async function exportSpeaker(table: Extract<Table, 'speakers'>) {
const { data, error } = await client.from(table).select().csv()
const { data, error } = await client.from(table)
.select()
.eq('is_open', true)
.csv()
if (error) return

return data
}

async function exportSponsor(table: Extract<Table, 'sponsors'>) {
const { data, error } = await client.from(table).select().csv()
const { data, error } = await client.from(table)
.select()
.eq('is_open', true)
.csv()
if (error) return

return data
}

async function exportAttendee(table: Extract<Table, 'attendees'>) {
const { data, error } = await client.from(table).select().csv()
const { data, error } = await client.from(table)
.select('display_name, image_url, image_file_name')
.neq('activated_at', null)
.csv()
if (error) return

return data
}

async function exportStaff(table: Extract<Table, 'staffs'>) {
const { data, error } = await client.from(table).select().csv()
const { data, error } = await client.from(table)
.select()
.eq('is_open', true)
.csv()
if (error) return

return data
Expand Down

0 comments on commit 0bc66c5

Please sign in to comment.