Are conditional .eq checks possible?

Is it possible to conditionally check for something in a table?
For intance:
I want to run
 return supabase
    .from('table1')
    .select(`*`)
    .eq('account', account)

on one function call, but then:
 return supabase
    .from('table1')
    .select(`*`)
    .eq('account', account)
    .eq('2ndThing', 2ndThing)

Can I toggle on/off that last eq or do I need to define a separate function?
Was this page helpful?