fix: reduce the number of latest investments fetched from 8 to 5

This commit is contained in:
Pattadon 2024-11-11 11:53:35 +07:00
parent 72d2c8bbfe
commit 36eb461f19

View File

@ -29,7 +29,7 @@ async function getLatestInvestment(
deals: { project_id: number; deal_amount: number; created_time: Date;}[]
) {
const llist = [];
const count = 8;
const count = 5;
// select project name from the given id
for (let i = deals.length - 1; i >= 0 && llist.length < count; --i) {
let { data: project, error } = await supabase.from("project").select("project_name").eq("id", deals[i].project_id);