mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
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:
1 parent
56447a9457
commit
5067020e99
1 file changed
+2
-6
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user