Skip to content

Commit

Permalink
fix(api): prevent updating category type (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
duongdev committed Jul 8, 2024
1 parent 7387185 commit bad2b04
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions apps/api/v1/services/category.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ export async function updateCategory({
category: Category
data: UpdateCategory
}) {
const { name, type, color, description, icon } = data
const { name, color, description, icon } = data

const updatedCategory = await prisma.category.update({
where: { id: category.id },
data: {
name,
type,
color,
description,
icon,
Expand Down
1 change: 0 additions & 1 deletion packages/validation/src/category.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const zCreateCategory = z.object({
export type CreateCategory = z.infer<typeof zCreateCategory>

export const zUpdateCategory = z.object({
type: CategoryTypeSchema.optional(),
name: z
.string()
.min(1, {
Expand Down

0 comments on commit bad2b04

Please sign in to comment.