From e0c870f553ef46f3a6305760ee4df4e21516ddc4 Mon Sep 17 00:00:00 2001 From: Mohsen Golestan Date: Tue, 3 Jun 2025 19:36:34 -0700 Subject: [PATCH] fix: dashboard patch api should not allow 'id' in updates --- packages/api/src/routers/api/dashboards.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/api/src/routers/api/dashboards.ts b/packages/api/src/routers/api/dashboards.ts index 48c9fb66e..857027042 100644 --- a/packages/api/src/routers/api/dashboards.ts +++ b/packages/api/src/routers/api/dashboards.ts @@ -1,7 +1,4 @@ -import { - DashboardSchema, - DashboardWithoutIdSchema, -} from '@hyperdx/common-utils/dist/types'; +import { DashboardWithoutIdSchema } from '@hyperdx/common-utils/dist/types'; import express from 'express'; import { groupBy } from 'lodash'; import _ from 'lodash'; @@ -59,7 +56,7 @@ router.patch( params: z.object({ id: objectIdSchema, }), - body: DashboardSchema.partial(), + body: DashboardWithoutIdSchema.partial(), }), async (req, res, next) => { try {