chore: add uniqid when updating version
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
import { defineVersion } from "verzod"
|
import { defineVersion } from "verzod"
|
||||||
import { V0_SCHEMA } from "./0"
|
import { V0_SCHEMA } from "./0"
|
||||||
|
import { uniqueId } from "lodash"
|
||||||
|
|
||||||
export const V1_SCHEMA = z.object({
|
export const V1_SCHEMA = z.object({
|
||||||
v: z.literal(1),
|
v: z.literal(1),
|
||||||
@@ -28,7 +29,7 @@ export default defineVersion({
|
|||||||
const result: z.infer<typeof V1_SCHEMA> = {
|
const result: z.infer<typeof V1_SCHEMA> = {
|
||||||
...old,
|
...old,
|
||||||
v: 1,
|
v: 1,
|
||||||
id: old.id ?? "",
|
id: old.id ?? uniqueId(),
|
||||||
variables: old.variables.map((variable) => {
|
variables: old.variables.map((variable) => {
|
||||||
return {
|
return {
|
||||||
...variable,
|
...variable,
|
||||||
|
|||||||
Reference in New Issue
Block a user