Skip to content

Commit

Permalink
Fix types 2
Browse files Browse the repository at this point in the history
  • Loading branch information
pdovhomilja committed Nov 2, 2023
1 parent f4b2b2f commit 38d805f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion actions/crm/opportunity/get-expected-revenue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { prismadb } from "@/lib/prisma";
import { crm_Opportunities } from "@prisma/client";

export const getExpectedRevenue = async () => {
const activeOpportunities = await prismadb.crm_Opportunities.findMany({
Expand All @@ -8,7 +9,8 @@ export const getExpectedRevenue = async () => {
});

const totalAmount = activeOpportunities.reduce(
(sum: number, opportunity) => sum + Number(opportunity.budget),
(sum: number, opportunity: crm_Opportunities) =>
sum + Number(opportunity.budget),
0
);

Expand Down

0 comments on commit 38d805f

Please sign in to comment.