mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-18 21:44:06 +01:00
32 lines
681 B
TypeScript
32 lines
681 B
TypeScript
import { SupabaseClient } from "@supabase/supabase-js";
|
|
|
|
export const getInvestmentCountsByProjectsIds = (client: SupabaseClient, projectIds: string[]) => {
|
|
return client
|
|
.from("investment_deal")
|
|
.select("*", {
|
|
count: "exact",
|
|
head: true,
|
|
})
|
|
.in("project_id", projectIds);
|
|
};
|
|
|
|
export const getInvestmentByUserId = (client: SupabaseClient, userId: string) => {
|
|
return client
|
|
.from("investment_deal")
|
|
.select(
|
|
`
|
|
id,
|
|
...project_id (
|
|
project_id:id,
|
|
project_name,
|
|
project_short_description,
|
|
dataroom_id
|
|
),
|
|
deal_amount,
|
|
investor_id,
|
|
created_time
|
|
`
|
|
)
|
|
.eq("investor_id", userId);
|
|
};
|