Is your feature request related to a problem? Please describe.
The /api/streak route was throwing several compilation errors during development due to a strict structural type mismatch with BadgeParams. Optional query parameters parsed by Zod as string | undefined were causing type assignment errors, and the custom year validation refinement was incorrectly using standard return blocks instead of the Zod context ctx.
Describe the solution you'd like
Corrected year validation inside lib/validations.ts using superRefine and native ctx.addIssue.
- Updated
app/api/streak/route.ts to build the params object safely, filtering out or explicitly casting optional parameters to satisfy BadgeParams.
- Maintained raw values for color strings (
bg, text, accent) to avoid test assertion mismatches.Corrected year validation inside lib/validations.ts using superRefine and native ctx.addIssue.
- Updated
app/api/streak/route.ts to build the params object safely, filtering out or explicitly casting optional parameters to satisfy BadgeParams.
- Maintained raw values for color strings (
bg, text, accent) to avoid test assertion mismatches.
Describe alternatives you've considered
Additionally, testing assertions failed because custom colors were altered incorrectly and the year validator error message string mismatched expected test constants.
@JhaSourav07 kindly assign it...I fixed that issue. once to assign it to me, I will cerate pull request
Is your feature request related to a problem? Please describe.
The
/api/streakroute was throwing several compilation errors during development due to a strict structural type mismatch withBadgeParams. Optional query parameters parsed by Zod asstring | undefinedwere causing type assignment errors, and the custom year validation refinement was incorrectly using standard return blocks instead of the Zod contextctx.Describe the solution you'd like
Corrected
yearvalidation insidelib/validations.tsusingsuperRefineand nativectx.addIssue.app/api/streak/route.tsto build theparamsobject safely, filtering out or explicitly casting optional parameters to satisfyBadgeParams.bg,text,accent) to avoid test assertion mismatches.Correctedyearvalidation insidelib/validations.tsusingsuperRefineand nativectx.addIssue.app/api/streak/route.tsto build theparamsobject safely, filtering out or explicitly casting optional parameters to satisfyBadgeParams.bg,text,accent) to avoid test assertion mismatches.Describe alternatives you've considered
Additionally, testing assertions failed because custom colors were altered incorrectly and the year validator error message string mismatched expected test constants.
@JhaSourav07 kindly assign it...I fixed that issue. once to assign it to me, I will cerate pull request