blazingbowser
blazingbowser
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/30/2023 in #questions
Why I am not able to use camelCase to use prisma models in trpc if I am using PascalCase name them
I have generated the schema and have also pushed it
6 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/30/2023 in #questions
Why I am not able to use camelCase to use prisma models in trpc if I am using PascalCase name them
but for better reffrence I want to keep it SkuImage but I am unable to do it
6 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/30/2023 in #questions
Why I am not able to use camelCase to use prisma models in trpc if I am using PascalCase name them
everything is working fine if I keep model's name Image
6 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/30/2023 in #questions
Why I am not able to use camelCase to use prisma models in trpc if I am using PascalCase name them
yes
6 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/29/2023 in #questions
How to add Many to Many relation fields in `z.object` and how to write procedure for it ?
there was a syntax error the fields should be inside data
data: {
...rest,
categories: {
connect: categories.map((c) => ({id: c}))
},
images: {
connect: images.map((i) => ({id: i}))
},
skus: {
connect: skus.map((s) => ({id: s}))
}
}
data: {
...rest,
categories: {
connect: categories.map((c) => ({id: c}))
},
images: {
connect: images.map((i) => ({id: i}))
},
skus: {
connect: skus.map((s) => ({id: s}))
}
}
20 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/29/2023 in #questions
How to add Many to Many relation fields in `z.object` and how to write procedure for it ?
20 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/29/2023 in #questions
How to add Many to Many relation fields in `z.object` and how to write procedure for it ?
think I should // @ts-ignore and move on 👀
20 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/29/2023 in #questions
How to add Many to Many relation fields in `z.object` and how to write procedure for it ?
20 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/29/2023 in #questions
How to add Many to Many relation fields in `z.object` and how to write procedure for it ?
Do I have to define any types here ?
model Category {
id String @id @default(cuid())
name String
created_at DateTime @default(now())
updated_at DateTime @updatedAt
products Product[]
}

model Product {
id String @id @default(cuid())
name String
description String?
selling_price Float
discount_price Float?
tags String[]
created_at DateTime @default(now())
updated_at DateTime @updatedAt
images Image[]
skus Sku[]
categories Category[]
}
model Category {
id String @id @default(cuid())
name String
created_at DateTime @default(now())
updated_at DateTime @updatedAt
products Product[]
}

model Product {
id String @id @default(cuid())
name String
description String?
selling_price Float
discount_price Float?
tags String[]
created_at DateTime @default(now())
updated_at DateTime @updatedAt
images Image[]
skus Sku[]
categories Category[]
}
20 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/29/2023 in #questions
How to add Many to Many relation fields in `z.object` and how to write procedure for it ?
I ran the command to genrate prisma types turbo db:generate
20 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/29/2023 in #questions
How to add Many to Many relation fields in `z.object` and how to write procedure for it ?
what should I do ?
20 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/29/2023 in #questions
How to add Many to Many relation fields in `z.object` and how to write procedure for it ?
20 replies
TTCTheo's Typesafe Cult
Created by blazingbowser on 6/29/2023 in #questions
How to add Many to Many relation fields in `z.object` and how to write procedure for it ?
Thanks, I am trying this, I will ask if have any issue
20 replies