Skip to content

Commit

Permalink
feat(api): allow passing id when creating budget (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkdev98 authored Jul 19, 2024
1 parent 93c8f9a commit c328e93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/api/v1/services/budget.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export async function createBudget({
data: CreateBudget
}) {
const {
id,
name,
type,
description,
Expand All @@ -158,6 +159,7 @@ export async function createBudget({

const budget = await prisma.budget.create({
data: {
id,
name,
type,
description,
Expand Down
1 change: 1 addition & 0 deletions packages/validation/src/budget.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { z } from 'zod'
import { BudgetPeriodTypeSchema, BudgetTypeSchema } from './prisma'

export const zCreateBudget = z.object({
id: z.string().cuid2().optional(),
name: z.string(),
description: z.string().optional(),
preferredCurrency: z.string(),
Expand Down

0 comments on commit c328e93

Please sign in to comment.