Is there any way to create a column from tanstack/react-table using two accessor keys? The data I'm receiving comes in this form:
model Reminder {
id String @id @default(auto()) @map("_id") @db.ObjectId
userId String @db.ObjectId
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
recurringDigit String?
recurringString String?
priority String
title String
description String?
location String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade )
}
And I'd like to create one column called 'Every' that combines both recurringString and recurringDigit into one entity, this is what I have, not working at all:
import { ColumnDef } from "@tanstack/react-table";
import { Reminder } from "@prisma/client";
export const columns: ColumnDef<
Omit<Reminder, "updatedAt" | "createdAt" | "id" | "userId"> & {
recurring: boolean;
}
>[] = [
{
accessorFn: (frequency: string, date: string) => string,
header: 'Every'
}
];