Skip to content

Commit

Permalink
Refactor: updated query with changes to volunteer preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
me-liu committed Dec 3, 2024
1 parent 65bcce1 commit 6ca059c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions api/supabase/queries/onboarding.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { GeneralInfo, Preferences } from '@/utils/onboardingContext';
import { GeneralInfo, Preferences, Role } from '@/utils/onboardingContext';
import supabase from '../createClient';

export async function submitOnboardingData(
generalInfo: GeneralInfo,
preferences: Preferences,
role: Role,
): Promise<void> {
try {
const { data: volunteerData, error: volunteerError } = await supabase
Expand All @@ -23,12 +24,16 @@ export async function submitOnboardingData(
.from('volunteer_preferences')
.insert([
{
role: [
role.isPerformer ? 'performer' : null,
role.isHost ? 'host' : null,
].filter(Boolean),
facility_type: preferences.facilityType,
city: preferences.location,
audience: preferences.audience,
instruments: preferences.preferredEquipment,
type_of_act: preferences.typeOfAct,
locations: preferences.location,
audience_type: preferences.audience,
performer_type: preferences.typeOfAct,
genre: preferences.genre,
grouping: preferences.grouping,
},
]);

Expand Down

0 comments on commit 6ca059c

Please sign in to comment.