this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

prisma: typecheck did fields as @atcute Did

Clément 2e46237d db3f355f

+25 -2
+1 -1
app/src/contexts/auth.tsx
··· 34 34 session.clear(); 35 35 return { did: null }; 36 36 } 37 - return { did: user.did as Did }; 37 + return { did: user.did }; 38 38 }, 39 39 ); 40 40
+24 -1
app/src/server/db.server.ts
··· 1 + import type { Did } from '@atcute/lexicons'; 1 2 import { PrismaD1 } from '@prisma/adapter-d1'; 2 3 import { env } from 'cloudflare:workers'; 3 4 4 5 import { PrismaClient } from '~/generated/prisma/client.js'; 5 6 6 7 const adapter = new PrismaD1(env.DB); 7 - export const prisma = new PrismaClient({ adapter }); 8 + export const prisma = new PrismaClient({ adapter }).$extends({ 9 + name: 'typed did', 10 + result: { 11 + user: { 12 + did: { 13 + needs: { did: true }, 14 + compute: (u) => u.did as Did, 15 + }, 16 + }, 17 + session: { 18 + userDid: { 19 + needs: { userDid: true }, 20 + compute: (s) => s.userDid as Did, 21 + }, 22 + }, 23 + oAuthSession: { 24 + did: { 25 + needs: { did: true }, 26 + compute: (s) => s.did as Did, 27 + }, 28 + }, 29 + }, 30 + });