mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-06 07:52:27 -05:00
* Test * Add pretty formatting * Fix Tests * Fix Tests * Fix Tests * Fix * Add pretty formatting fix * Fix * Test * Fix tests * Clean typeckech * Add prettier check * Fix api tsconfig * Fix api tsconfig * Fix tsconfig * Fix * Fix * Prettier
13 lines
320 B
TypeScript
13 lines
320 B
TypeScript
import {OrderBy} from 'common/votes/constants'
|
|
import {db} from 'web/lib/supabase/db'
|
|
|
|
export const getVotes = async (params: {orderBy: OrderBy}) => {
|
|
const {orderBy} = params
|
|
const {data, error} = await db.rpc('get_votes_with_results' as any, {
|
|
order_by: orderBy,
|
|
})
|
|
if (error) throw error
|
|
|
|
return data
|
|
}
|