fix: improve type safety in follow.ts by removing any usages (#550)#575
Conversation
|
@yachikadev is attempting to deploy a commit to the Prashantkumar Khatri's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @yachikadev, Thanks for opening this pull request. This PR has been automatically classified based on the files modified. Applied Labels
Primary Review Area
Reviewer@Harxhit has been identified as the primary reviewer for this pull request. If you have any questions regarding the affected area or implementation details, feel free to reach out to the assigned reviewer. Thank you for your contribution! |
CI — All Checks PassedBackend — PASS
Mobile — SKIP
Web — SKIP
Last updated: |
|
Congratulations @yachikadev on getting PR #575 merged! Thank you for your contribution to the project. To receive the appropriate GSSoC labels and recognition, please mention @Harxhit in the #get-labels channel on our Discord server and share your merged PR link. |
Summary
Removes all remaining
anyusages fromfollow.tsand replaces them with proper Fastify and JWT types, reusing the existing type definitions insrc/types/fastify.d.ts.Changes
request.server as anyand(app as any).authenticatecasts —FastifyInstance.authenticateandrequest.serverare already properly typed via the existingfastify.d.tsaugmentation, so no casts are needed.(request as any).user = payloadwithrequest.user = payload, typing the JWT payload usingrequest.jwtVerify<AuthenticatedUser>()(imported from../types/fastify.js) so it matches theAuthenticatedUsertype already declared forrequest.user.(request.user as any).idusages withrequest.user.id.catch (error: any)withcatch (error)and used the existinggetErrorMessageutility, matching the error-handling pattern already used elsewhere in this file.Testing
npx tsc --noEmitpasses with no errors.Closes #550