From 47cccf5cb6e647cc126b1e7af1abdd26df6d61d5 Mon Sep 17 00:00:00 2001 From: Haxfx Date: Fri, 15 Mar 2024 20:23:03 +0100 Subject: [PATCH] bugfix(project): updated config token supply --- components/dashboard/create-project-form.tsx | 2 +- database/schemas/projects.schema.ts | 2 ++ server-actions/projects/projects.actions.ts | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/dashboard/create-project-form.tsx b/components/dashboard/create-project-form.tsx index 8cd6346..27dc7fd 100644 --- a/components/dashboard/create-project-form.tsx +++ b/components/dashboard/create-project-form.tsx @@ -94,7 +94,7 @@ export const ProjectFormDataSchema = z.object({ description: z.string().min(1, { message: "Required", }), - tokenSupply: z.string().optional(), + tokenSupply: z.number().optional(), tokenName: z.string().optional(), website: z.string().optional(), whitepaper: z.string().optional(), diff --git a/database/schemas/projects.schema.ts b/database/schemas/projects.schema.ts index af82daa..98f3c7f 100644 --- a/database/schemas/projects.schema.ts +++ b/database/schemas/projects.schema.ts @@ -110,6 +110,8 @@ export const NewProjectSchema = InsertProjectSchema.extend({}).omit({ export const NewProjectWithTagsSchema = InsertProjectSchema.extend({ tags: z.array(z.number()), + communitySize: z.number(), + projectType: z.string(), }) export const updateProjectSchema = BaseSchema.extend({ diff --git a/server-actions/projects/projects.actions.ts b/server-actions/projects/projects.actions.ts index c4dc732..6480f9b 100644 --- a/server-actions/projects/projects.actions.ts +++ b/server-actions/projects/projects.actions.ts @@ -22,7 +22,12 @@ export const createProjectWithTagsAction = async ( ) => { await authGuard() const { tags, ...newProject } = newProjectWithTagsParams - const payload = NewProjectSchema.parse(newProject) + const tempProject = { + ...newProject, + communitySize: 20000, + projectType: "defaultType", + } + const payload = NewProjectSchema.parse(tempProject) const { project } = await createProjectMutation(payload) await addTagsToProjectMutation(project.id, tags) revalidatePath("/")