bento
bento
TTCTheo's Typesafe Cult
Created by bento on 7/10/2023 in #questions
React table filter type error (.toLowerCase)
8 replies
TTCTheo's Typesafe Cult
Created by bento on 5/15/2023 in #questions
creating a type based on the input
export function getType(cols: Column[] | undefined){
if (!cols) return z.object({});
const schema = {};
cols.forEach((col) => {
schema[col.id] = z.string();
});
return z.object(schema);
}
export function getType(cols: Column[] | undefined){
if (!cols) return z.object({});
const schema = {};
cols.forEach((col) => {
schema[col.id] = z.string();
});
return z.object(schema);
}
im getting this error on schema[col.id]
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
No index signature with a parameter of type 'string' was found on type '{}'.
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
No index signature with a parameter of type 'string' was found on type '{}'.
4 replies
TTCTheo's Typesafe Cult
Created by bento on 5/9/2023 in #questions
Looking for TS Tanstack table resources/tutorials
hey guys I'm having trouble using tanstack table in my create-t3-app does anyone have any resources/tutorials to share
3 replies
TTCTheo's Typesafe Cult
Created by bento on 5/4/2023 in #questions
changing col-span with template literal
7 replies
TTCTheo's Typesafe Cult
Created by bento on 5/2/2023 in #questions
How to manage data for a AirTable clone
1 replies
TTCTheo's Typesafe Cult
Created by bento on 4/28/2023 in #questions
2 queries in child component or 1 in parent component
lets say i have 2 components that need that same data to i query once in the parent component and pass it as props to the child or do i query once in each child component
5 replies
TTCTheo's Typesafe Cult
Created by bento on 4/21/2023 in #questions
Relation Mode Prisma Indexes
I'm getting this warning in my schema on the okr and parentTask lines any idea how to solve this?
With `relationMode = "prisma"`, no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to poor performance when querying these fields. We recommend adding an index manually. Learn more at https://pris.ly/d/relation-mode-prisma-indexes"
With `relationMode = "prisma"`, no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to poor performance when querying these fields. We recommend adding an index manually. Learn more at https://pris.ly/d/relation-mode-prisma-indexes"
model Task {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String @db.VarChar(255)
content String @default("No Content") @db.Text
status String @default("TODO") @db.VarChar(255)
authorId String @db.VarChar(255)
spaceId String @db.VarChar(255)
dueDate DateTime
assignees User[] @relation("assignee")
space Space? @relation(fields: [spaceId], references: [id])
parentId String?
parentTask Task? @relation("subTask", fields: [parentId], references: [id], onUpdate: NoAction, onDelete: NoAction)
childTasks Task[] @relation("subTask")
okr okr? @relation(fields: [okrId], references: [id])
okrId String?

@@index([spaceId, parentId, okrId])}
model Task {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String @db.VarChar(255)
content String @default("No Content") @db.Text
status String @default("TODO") @db.VarChar(255)
authorId String @db.VarChar(255)
spaceId String @db.VarChar(255)
dueDate DateTime
assignees User[] @relation("assignee")
space Space? @relation(fields: [spaceId], references: [id])
parentId String?
parentTask Task? @relation("subTask", fields: [parentId], references: [id], onUpdate: NoAction, onDelete: NoAction)
childTasks Task[] @relation("subTask")
okr okr? @relation(fields: [okrId], references: [id])
okrId String?

@@index([spaceId, parentId, okrId])}
5 replies
TTCTheo's Typesafe Cult
Created by bento on 4/17/2023 in #questions
I have spaces that can have many members and one author how do i define my schema
8 replies
TTCTheo's Typesafe Cult
Created by bento on 4/14/2023 in #questions
getting 404 in production but works locally
32 replies
TTCTheo's Typesafe Cult
Created by bento on 4/12/2023 in #questions
How to store MD
Im building a CRM/Task management tool, i want users to be able to write MD descriptions for tasks how do i go about storing this in the db (mysql & prisma)
5 replies
TTCTheo's Typesafe Cult
Created by bento on 4/9/2023 in #questions
Middleware redirect not working
27 replies
TTCTheo's Typesafe Cult
Created by bento on 1/5/2023 in #questions
How do I make the grid or flex item grow to the size of the parent on click?
i have tried to make the other flex items hidden on click but I can't figure out how to animate it.
1 replies