Building a new website everyday to kickstart any new project I am recruited for.
added more weight definitions
2 files changed, +3 -2
+1-0008_hygofitweb/app/api/generate/route.ts
| @@ -67,6 +67,7 @@ export async function POST(request: Request) { | ||
| 67 | 67 | if (content) { |
| 68 | 68 | try { |
| 69 | 69 | const data = JSON.parse(content); |
| 70 | + console.log(data); | |
| 70 | 71 | const actualDuration = data.data.reduce( |
| 71 | 72 | (acc: number, group: { durationMinutes: number }) => { |
| 72 | 73 | return acc + group.durationMinutes; |
+2-2008_hygofitweb/lib/schemas/v4.ts
| @@ -23,7 +23,7 @@ export const v4 = z.object({ | ||
| 23 | 23 | .number() |
| 24 | 24 | .int() |
| 25 | 25 | .describe( |
| 26 | - "The total duration of all the exercise groups in minutes. Add up durationMinutes for all exercise groups" | |
| 26 | + "The total duration of all the exercise groups in minutes. The durationMinutes of all exercise groups must add up exactly to this value." | |
| 27 | 27 | ), |
| 28 | 28 | data: z.array( |
| 29 | 29 | z.object({ |
| @@ -66,7 +66,7 @@ export const v4 = z.object({ | ||
| 66 | 66 | .describe( |
| 67 | 67 | "The rest time in seconds. 0 if no rest. Only the last set should have a rest on supersets, giant sets, and drop sets." |
| 68 | 68 | ), |
| 69 | - weight: z.string(), | |
| 69 | + weight: z.enum(["light", "medium", "heavy", "max", "bodyweight"]), | |
| 70 | 70 | notes: z.string(), |
| 71 | 71 | }) |
| 72 | 72 | ) |