EnricoBaivo
EnricoBaivo
Explore posts from servers
PPrisma
Created by EnricoBaivo on 7/30/2024 in #help-and-questions
struggle with conditional query
MARK AS SOLVED PLEASE
5 replies
PPrisma
Created by EnricoBaivo on 7/30/2024 in #help-and-questions
struggle with conditional query
!help
5 replies
PPrisma
Created by EnricoBaivo on 7/30/2024 in #help-and-questions
struggle with conditional query
...(input.displayOnlyUnplayedPredictions && userscoreCondition),
5 replies
TTCTheo's Typesafe Cult
Created by Steve Melons on 11/30/2023 in #questions
Extend next-auth session with drizzle adapter
I mean i did it also like you did but im using MySQL and i cant return on insert. So i do a select return but this could be null and the create callback dosent allow that:
async createUser(data) {
const id = crypto.randomUUID();
await client.insert(users).values({ ...data, id });
return await client.query.users
.findFirst({
where: (fields, operations) => operations.eq(fields.id, id),
})
.then((res) => res ?? null);
},
async createUser(data) {
const id = crypto.randomUUID();
await client.insert(users).values({ ...data, id });
return await client.query.users
.findFirst({
where: (fields, operations) => operations.eq(fields.id, id),
})
.then((res) => res ?? null);
},
.....updatedAt: string; } | null' is not assignable to type 'AdapterUser'.
Type 'null' is not assignable to type 'AdapterUser'.ts(2322)
.....updatedAt: string; } | null' is not assignable to type 'AdapterUser'.
Type 'null' is not assignable to type 'AdapterUser'.ts(2322)
75 replies
TTCTheo's Typesafe Cult
Created by Steve Melons on 11/30/2023 in #questions
Extend next-auth session with drizzle adapter
Type '(data: Omit<AdapterUser, "id">) => Promise<AdapterUser | { [x: string]: any; } | undefined>' is not assignable to type '(user: Omit<AdapterUser, "id">) => Awaitable<AdapterUser>'.
Type 'Promise<AdapterUser | { [x: string]: any; } | undefined>' is not assignable to type 'Awaitable<AdapterUser>'.
Type 'Promise<AdapterUser | { [x: string]: any; } | undefined>' is not assignable to type 'PromiseLike<AdapterUser>'.
Types of property 'then' are incompatible.
Type '<TResult1 = AdapterUser | { [x: string]: any; } | undefined, TResult2 = never>(onfulfilled?: ((value: AdapterUser | { [x: string]: any; } | undefined) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | ... 1 more ... | undefined) => Promise<...>' is not assignable to type '<TResult1 = AdapterUser, TResult2 = never>(onfulfilled?: ((value: AdapterUser) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | ... 1 more ... | undefined) => PromiseLike<...>'.
Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'AdapterUser | { [x: string]: any; } | undefined' is not assignable to type 'AdapterUser'.
Type 'undefined' is not assignable to type 'AdapterUser'.ts(2322)
adapters.d.ts(257, 5): The expected type comes from property 'createUser' which is declared here on type 'Adapter'
Type '(data: Omit<AdapterUser, "id">) => Promise<AdapterUser | { [x: string]: any; } | undefined>' is not assignable to type '(user: Omit<AdapterUser, "id">) => Awaitable<AdapterUser>'.
Type 'Promise<AdapterUser | { [x: string]: any; } | undefined>' is not assignable to type 'Awaitable<AdapterUser>'.
Type 'Promise<AdapterUser | { [x: string]: any; } | undefined>' is not assignable to type 'PromiseLike<AdapterUser>'.
Types of property 'then' are incompatible.
Type '<TResult1 = AdapterUser | { [x: string]: any; } | undefined, TResult2 = never>(onfulfilled?: ((value: AdapterUser | { [x: string]: any; } | undefined) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | ... 1 more ... | undefined) => Promise<...>' is not assignable to type '<TResult1 = AdapterUser, TResult2 = never>(onfulfilled?: ((value: AdapterUser) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | ... 1 more ... | undefined) => PromiseLike<...>'.
Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'AdapterUser | { [x: string]: any; } | undefined' is not assignable to type 'AdapterUser'.
Type 'undefined' is not assignable to type 'AdapterUser'.ts(2322)
adapters.d.ts(257, 5): The expected type comes from property 'createUser' which is declared here on type 'Adapter'
`
75 replies
TTCTheo's Typesafe Cult
Created by Steve Melons on 11/30/2023 in #questions
Extend next-auth session with drizzle adapter
Thanks for you responses ! Yeah, due to research i also ended up making my own adapter, but i am struggling with the correct Typeing.
declare module "@auth/core/adapters" {
interface AdapterUser {
id: string;
email: string;
emailVerified: Date | null;
image: string;
osuUserId: number;
isAdmin: boolean;
isAlphaTester: boolean;
isBetaTester: boolean;
isNew: boolean;
createdAt: Date | null;
updatedAt: Date | null;
lastLogin: Date | null;
}
}
declare module "@auth/core/types" {
interface AdapterUser {
emailVerified: Date | null;
osuUserId: number;
username: string;
isAdmin: boolean;
image: string;
isAlphaTester: boolean;
isBetaTester: boolean;
isNew: boolean;
createdAt: Date | null;
updatedAt: Date | null;
lastLogin: Date | null;
}
}
declare module "@auth/core/adapters" {
interface AdapterUser {
id: string;
email: string;
emailVerified: Date | null;
image: string;
osuUserId: number;
isAdmin: boolean;
isAlphaTester: boolean;
isBetaTester: boolean;
isNew: boolean;
createdAt: Date | null;
updatedAt: Date | null;
lastLogin: Date | null;
}
}
declare module "@auth/core/types" {
interface AdapterUser {
emailVerified: Date | null;
osuUserId: number;
username: string;
isAdmin: boolean;
image: string;
isAlphaTester: boolean;
isBetaTester: boolean;
isNew: boolean;
createdAt: Date | null;
updatedAt: Date | null;
lastLogin: Date | null;
}
}
`
75 replies
TTCTheo's Typesafe Cult
Created by Steve Melons on 11/30/2023 in #questions
Extend next-auth session with drizzle adapter
Hello Steve Melons, did you find a solution to extend the User data that is inserted on create ?
75 replies
TTCTheo's Typesafe Cult
Created by gwilliamnn on 10/17/2023 in #questions
New App Router is not working!
Downgrading to Next.js 13.5.4 fixes "Missing result" error
Downgrading to Next.js 13.5.4 fixes "Missing result" error
10 replies
TTCTheo's Typesafe Cult
Created by gwilliamnn on 10/17/2023 in #questions
New App Router is not working!
❌ tRPC failed on <no-path>: e.getSetCookie is not a function
⨯ TypeError: e.getSetCookie is not a function
at new f (D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:1:3273)
at A.wrap (D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:33745)
at D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:36428
at get mutableCookies [as mutableCookies] (D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:36438)
at D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:63049
❌ tRPC failed on <no-path>: e.getSetCookie is not a function
⨯ TypeError: e.getSetCookie is not a function
at new f (D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:1:3273)
at A.wrap (D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:33745)
at D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:36428
at get mutableCookies [as mutableCookies] (D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:36438)
at D:\osu-hub-frontend\node_modules\next\dist\compiled\next-server\app-route.runtime.dev.js:6:63049
10 replies
TTCTheo's Typesafe Cult
Created by gwilliamnn on 10/17/2023 in #questions
New App Router is not working!
i did i am using prisma with planetscale but like the issue describes ,the error is also happening with the starter of T3 with auth trpc and prisma.
10 replies
TTCTheo's Typesafe Cult
Created by gwilliamnn on 10/17/2023 in #questions
New App Router is not working!
I have the same issue with old npm dev and vercel dev
10 replies