Skip to content

Commit

Permalink
MODIFY: new prop on ExerciseWithOptionalSetsSchema and new infered ty…
Browse files Browse the repository at this point in the history
…pe needed for useWorkoutToDo custom hook
  • Loading branch information
srkuleo committed Sep 13, 2024
1 parent 3b384a4 commit ce7dc38
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ const ExerciseWithOptionalSetsSchema = ExerciseSchema.pick({
sets: z
.array(OptionalSetSchema)
.transform((sets) => sets.filter((set) => set.reps)),
done: z.boolean().optional(),
});

export type ExerciseToDoType = z.infer<typeof ExerciseWithOptionalSetsSchema>;

//Workout types and schemas

export type WorkoutActionResponse = {
Expand Down Expand Up @@ -118,6 +121,8 @@ export const WorkoutToDoSchema = WorkoutSchema.pick({
exercises: z.array(ExerciseWithOptionalSetsSchema),
});

export type WorkoutToDoType = z.infer<typeof WorkoutToDoSchema>;

//Auth types and schemas

export type AuthActionResponse = {
Expand Down

0 comments on commit ce7dc38

Please sign in to comment.