"Unsafe assignment of `any` value

I am using latest create-t3-app with prisma, tailwind nextAuth and trpc
3 Replies
pach
pachOP2y ago
// src/server/admins.ts
import { prisma } from "./db";


export async function userHasPermission(userId: string, permission: string): Promise<boolean> {
const adminProfile = await prisma.permissions.findFirst({
where: {
userId
}
})
//TODO: check permission
return true
}
// src/server/admins.ts
import { prisma } from "./db";


export async function userHasPermission(userId: string, permission: string): Promise<boolean> {
const adminProfile = await prisma.permissions.findFirst({
where: {
userId
}
})
//TODO: check permission
return true
}
here is all i have right now the errors im getting are
Unsafe call of an `any` typed value. Unsafe assignment of an `any` value. Unsafe member access .findFirst on an `any` value.
all on line 5 (const adminProfile = ....) nevermind just had to restart vscode not just the ts server lmao
Hunter
Hunter2y ago
Relaoding vscode worked for me too 🤦‍♂️ I'll just throw that 15 minutes into the fire. Thanks for the post
Loki
Loki13mo ago
🤦‍♂️ spent an !!!hour figuring this one out xx
Want results from more Discord servers?
Add your server