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.
This commit is contained in:
Marc-André Bombeck committed 2026-08-02 13:04:25 +02:00
1 parent 56447a9457
commit 5067020e99
1 file changed
+2 -6
+2 -6
View File
@@ -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;