feat: add onboarding with oldmarr import (#1606)
This commit is contained in:
24
packages/old-import/src/import/input.ts
Normal file
24
packages/old-import/src/import/input.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import SuperJSON from "superjson";
|
||||
import { z } from "zod";
|
||||
import { zfd } from "zod-form-data";
|
||||
|
||||
import { initialOldmarrImportSettings } from "../settings";
|
||||
|
||||
const boardSelectionMapSchema = z.map(
|
||||
z.string(),
|
||||
z.object({
|
||||
sm: z.boolean().nullable(),
|
||||
md: z.boolean().nullable(),
|
||||
lg: z.boolean().nullable(),
|
||||
}),
|
||||
);
|
||||
|
||||
export const importInitialOldmarrInputSchema = zfd.formData({
|
||||
file: zfd.file(),
|
||||
settings: zfd.json(initialOldmarrImportSettings),
|
||||
boardSelections: zfd.text().transform((value) => {
|
||||
const map = boardSelectionMapSchema.parse(SuperJSON.parse(value));
|
||||
return map;
|
||||
}),
|
||||
token: zfd.text().nullable(),
|
||||
});
|
||||
Reference in New Issue
Block a user