From 63cbaabf0783e5a83e85d1e5e4f5f029343c01de Mon Sep 17 00:00:00 2001 From: nivedin Date: Thu, 7 Mar 2024 18:34:45 +0530 Subject: [PATCH] chore: add uniqid when updating version --- packages/hoppscotch-data/src/environment/v/1.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hoppscotch-data/src/environment/v/1.ts b/packages/hoppscotch-data/src/environment/v/1.ts index 01562abe9..795e6746b 100644 --- a/packages/hoppscotch-data/src/environment/v/1.ts +++ b/packages/hoppscotch-data/src/environment/v/1.ts @@ -1,6 +1,7 @@ import { z } from "zod" import { defineVersion } from "verzod" import { V0_SCHEMA } from "./0" +import { uniqueId } from "lodash" export const V1_SCHEMA = z.object({ v: z.literal(1), @@ -28,7 +29,7 @@ export default defineVersion({ const result: z.infer = { ...old, v: 1, - id: old.id ?? "", + id: old.id ?? uniqueId(), variables: old.variables.map((variable) => { return { ...variable,