not a robot
not a robot
Explore posts from servers
KPCKevin Powell - Community
Created by not a robot on 3/25/2024 in #front-end
Not able to Scroll on Scroll Area that has full width
No description
1 replies
TTCTheo's Typesafe Cult
Created by not a robot on 5/31/2023 in #questions
Migrating to supabase from create-t3-turbo
Hey guys! I'm migrating a create-t3-turbo app to the supabase create-t3-turbo template, and I'm a bit confused about how you're supposed to go about adding the Profile model in the Prisma schema to the DB (although I renamed it to User), I saw a blog post about adding it using supabase triggers, but I'm not sure if that's the way you intended for people to do it. Any ideas on how to go about this or am I missing something?
3 replies
TTCTheo's Typesafe Cult
Created by not a robot on 5/30/2023 in #questions
Typescript issue causing trpc functions to not have type checking
4 replies
TTCTheo's Typesafe Cult
Created by not a robot on 12/25/2022 in #questions
Can't figure out how to disconnect in prisma
I've been trying to figure out how to disconnect feed from user for like 2 hours now, and I can't figure out what part I'm getting wrong, my function looks like this:
removeUserFromFeed: protectedProcedure
.input(z.object({ feedId: z.string() }))
.query(async ({ ctx, input }) => {
// Remove user from feed
await ctx.prisma.user.update({
where: {
id: ctx.session.user.id,
},
data: {
Feeds: {
disconnect: [
{
id: input.feedId,
},
],
},
},
});
}),
removeUserFromFeed: protectedProcedure
.input(z.object({ feedId: z.string() }))
.query(async ({ ctx, input }) => {
// Remove user from feed
await ctx.prisma.user.update({
where: {
id: ctx.session.user.id,
},
data: {
Feeds: {
disconnect: [
{
id: input.feedId,
},
],
},
},
});
}),
But on the id: input.feedId, I get Type '{ id: string; }' is not assignable to type 'UserFeedsWhereUniqueInput'. Does anyone know how to make it, so it removes the Feed from the User? Here's my schema:
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
Feeds UserFeeds[]
Items UserItem[]
}

model UserFeeds {
feed Feed @relation(fields: [feedId], references: [id])
feedId String
user User @relation(fields: [userId], references: [id])
userId String
Folder String?

@@id([feedId, userId])
}

model Feed {
id String @id @default(cuid())
title String @unique
LogoUrl String
url String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Users UserFeeds[]
items Item[]
}
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
Feeds UserFeeds[]
Items UserItem[]
}

model UserFeeds {
feed Feed @relation(fields: [feedId], references: [id])
feedId String
user User @relation(fields: [userId], references: [id])
userId String
Folder String?

@@id([feedId, userId])
}

model Feed {
id String @id @default(cuid())
title String @unique
LogoUrl String
url String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
Users UserFeeds[]
items Item[]
}
7 replies
TTCTheo's Typesafe Cult
Created by not a robot on 11/2/2022 in #questions
How to make a trpc function run automatically on start-up of server.
I'm working on a RSS reader like-app and am try to have function that runs every X minutes to refresh the feeds but can't seem to figure out how to go about this in trpc. Anyone have any suggestions?
67 replies