Skip to content

Commit

Permalink
fix: keep used properties in HelpRequestData
Browse files Browse the repository at this point in the history
  • Loading branch information
j8seangel committed Nov 15, 2024
1 parent 9defe94 commit 46827ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/casos-activos/solicitudes/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const dynamic = 'force-dynamic';
function parseData(data: Database['public']['Tables']['help_requests']['Row'][]): HelpRequestData[] {
return data.map((d) => {
// Remove unused properties to reduce the payload size
const { coordinates, crm_status, resources, user_id, ...rest } = d;
const { coordinates, location, ...rest } = d;
return {
...rest,
// Fix the coordinates to 3 decimals so locations have a 100m precision
Expand All @@ -21,7 +21,7 @@ function parseData(data: Database['public']['Tables']['help_requests']['Row'][])
}

const getData = async (supabase: SupabaseClient<Database>) => {
const { error, data } = await supabase.from('help_requests').select().eq('type', 'necesita');
const { error, data } = await supabase.from('help_requests').select('*').eq('type', 'necesita');

if (error) {
throw new Error('Error fetching solicita:', error);
Expand Down

0 comments on commit 46827ac

Please sign in to comment.