From 5067020e99eb82ab28b9035e8db682561745c6fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 2 Aug 2026 12:52:06 +0200 Subject: [PATCH] refactor(sharing): drop a cast the select already proves The invite lookup selects exactly the columns a grant party carries, so asserting the shape afterwards said nothing the types did not already know. --- src/app/api/account/grants/route.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/api/account/grants/route.ts b/src/app/api/account/grants/route.ts index c940c02c1..8d5c785a8 100644 --- a/src/app/api/account/grants/route.ts +++ b/src/app/api/account/grants/route.ts @@ -40,11 +40,7 @@ import { auditLog } from "@/lib/auth/audit"; import { prisma } from "@/lib/db"; import { annotate } from "@/lib/logging/context"; import { checkRateLimit } from "@/lib/rate-limit"; -import { - GRANT_PARTY_SELECT, - toGrantView, - type GrantParty, -} from "@/lib/sharing/grant-view"; +import { GRANT_PARTY_SELECT, toGrantView } from "@/lib/sharing/grant-view"; import { GrantError, inviteGrant } from "@/lib/sharing/grants"; import { inviteGrantSchema } from "@/lib/validations/account-sharing"; @@ -156,7 +152,7 @@ export const POST = apiHandler(async (request: NextRequest) => { }, }); - return apiSuccess(toGrantView(grant, invitee as GrantParty), 201); + return apiSuccess(toGrantView(grant, invitee), 201); } catch (err) { if (err instanceof GrantError) return grantErrorResponse(err); throw err;