mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-05 03:20:59 -05:00
14 lines
326 B
TypeScript
14 lines
326 B
TypeScript
import {db} from 'web/lib/supabase/db'
|
|
|
|
import {OrderBy} from "common/votes/constants";
|
|
|
|
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
|
|
}
|