Skip to content

Commit

Permalink
bugfix(project): updated config token supply
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxfx committed Mar 15, 2024
1 parent 1cbb726 commit 47cccf5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/dashboard/create-project-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 2 additions & 0 deletions database/schemas/projects.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
7 changes: 6 additions & 1 deletion server-actions/projects/projects.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("/")
Expand Down

0 comments on commit 47cccf5

Please sign in to comment.