chore: add uniqid when updating version

This commit is contained in:
nivedin
2024-03-07 18:34:45 +05:30
committed by Andrew Bastin
parent 40e8696a9a
commit 63cbaabf07

View File

@@ -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<typeof V1_SCHEMA> = {
...old,
v: 1,
id: old.id ?? "",
id: old.id ?? uniqueId(),
variables: old.variables.map((variable) => {
return {
...variable,