Skip to content

Commit

Permalink
πŸŠβ€β™‚οΈ Update steps provider again
Browse files Browse the repository at this point in the history
  • Loading branch information
nezouse committed Mar 20, 2024
1 parent 9edb3ea commit 802873f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/app/waves/[waveId]/applications/create/stepsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const applicationDataSchema = mainDetailsSchema
.merge(teamInformationSchema)
.merge(grantScopingSchema)
.merge(roadmapSchema)
.merge(resourcesSchema);
.merge(resourcesSchema)
.partial();
export type ApplicationData = z.infer<typeof applicationDataSchema>;

const stepsStateSchema = z.object({
Expand Down Expand Up @@ -98,7 +99,9 @@ function getInitialState(initialArgs: StepsState): StepsState {
if (localStorageValue) {
return stepsStateSchema.parse(JSON.parse(localStorageValue));
}
} catch {}
} catch (err) {
console.error(err);
}
}

return initialArgs;
Expand Down
2 changes: 1 addition & 1 deletion src/constants/validationSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { z } from "zod";
import { errorMessages } from "./errorMessages";

export const numberSchema = (fieldName: string) => {
return z
return z.coerce
.string()
.min(1, { message: errorMessages.nonEmptyString(fieldName) })
.regex(/^[-]?(0?\.\d+|\d+(\.\d+)?)$/, {
Expand Down

0 comments on commit 802873f

Please sign in to comment.