Skip to content

Commit

Permalink
fix(api): fix budget list not return correct type (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkdev98 committed Jul 23, 2024
1 parent 6c8c4c6 commit c5df0cd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/api/v1/services/budget.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
import type { CreateBudget, UpdateBudget } from '@6pm/validation'
import {
type Budget,
type BudgetPeriodConfig,
BudgetUserPermission,
type Prisma,
type User,
Expand All @@ -16,6 +17,10 @@ const BUDGET_INCLUDE: Prisma.BudgetInclude = {
periodConfigs: true,
}

type BudgetPopulated = Budget & {
periodConfigs: BudgetPeriodConfig[]
}

export async function canUserCreateBudget({
// biome-ignore lint/correctness/noUnusedVariables: <explanation>
user,
Expand Down Expand Up @@ -277,7 +282,7 @@ async function findBudgetLatestPeriodConfig({
})
}

async function verifyBudgetPeriods({ budget }: { budget: Budget }) {
async function verifyBudgetPeriods({ budget }: { budget: BudgetPopulated }) {
const latestPeriodConfig = await findBudgetLatestPeriodConfig({
budgetId: budget.id,
})
Expand Down

0 comments on commit c5df0cd

Please sign in to comment.