Skip to content

Commit

Permalink
admin change schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyvu committed Jan 23, 2025
1 parent 05a145b commit a383819
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/lambda/update/adminChangeSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const updateIdAdminChangeSchema = z
})
.and(z.record(z.string(), z.any()));

// TODO
export const splitSPAAdminChangeSchema = z.object({
id: z.string(),
adminChangeType: z.literal("split-spa"),
Expand Down Expand Up @@ -54,3 +53,11 @@ export const transformedUpdateIdSchema = updateIdAdminChangeSchema.transform((da
id: `${data.id}`,
timestamp: Date.now(),
}));

export const transformedSplitSPASchema = updateIdAdminChangeSchema.transform((data) => ({
...data,
event: "split-spa",
packageId: data.id,
id: `${data.id}`,
timestamp: Date.now(),
}));

0 comments on commit a383819

Please sign in to comment.