word
word
Explore posts from servers
TTCTheo's Typesafe Cult
Created by word on 7/11/2023 in #questions
Check if unique key exists before create
I have to unique constraints, one for a single key and other for two combined. But, when I get the unique constraint error at the create statement, it comes without the key that caused it, and I'd have to give a vague error response to the user. I looked it up and it seems like PLanetScale currently can't figure out a solution for this "not avaiable" column error message. So, as I can't treat it properly on the server, I'm trying it on the client. An dto have the least amount of queries plus the fast response to the user, I opted for the onBlur event. But I'm totally open for other solutions.
4 replies
TTCTheo's Typesafe Cult
Created by Gabool on 3/18/2023 in #questions
tailwind w- h- custom value's
Well, I don't know if that's what you're seeking, but you might be missing 0.5, 1.5, and so on up until 2.5. Apart from this, there really are situations in which a small adjustment, more precise and particular, is necessary. If you could point out some use cases, I could share some thoughts.
5 replies
TTCTheo's Typesafe Cult
Created by Vimes on 2/21/2023 in #questions
Typescript with array data from shitty CMS
If ContentProps should be an array of those objects, them you could type it like that directly:
type ContentProps = {
level: string;
name: string;
beskrivelse: string;
vurdering?: string;
}[]
type ContentProps = {
level: string;
name: string;
beskrivelse: string;
vurdering?: string;
}[]
8 replies
TTCTheo's Typesafe Cult
Created by Vimes on 2/21/2023 in #questions
Typescript with array data from shitty CMS
You're saying in your type that the props are an array of that object, but them you're trying to destructure a object property { allContent } from what should be an array. If your code works, you're receiving another thing and "lying" with ts
8 replies
TTCTheo's Typesafe Cult
Created by Temp Change on 2/13/2023 in #questions
Should I use Tutorials?
I was almost at the same spot as you and just went through the react beta docs and started my project. I learn what I need, and, when I got time, I try to go in-depth into some topics. The result won't be great, but if it's for learning, it's more than worth it. Better than any tutorial.
53 replies
TTCTheo's Typesafe Cult
Created by Lopen on 12/18/2022 in #questions
does null get overlooked during prisma update
For Prisma null is a value, so it will override. Check this: https://www.prisma.io/docs/concepts/components/prisma-client/null-and-undefined
5 replies
TTCTheo's Typesafe Cult
Created by Lopen on 12/18/2022 in #questions
does null get overlooked during prisma update
I was testing this today and as far as I've seen Prisma will put null.
5 replies