Why do i get the wrong type
export type ForumPostType = Prisma.ForumGetPayload<{
include: {
// where: {
// id: string;
// };
author: {
select: {
name: true;
username: true;
image: true;
likes:
| {
// where: { id: string };
select: {
id: true;
};
}
| false;
_count: {
select: {
likes: true;
};
};
};
};
};
}>;export type ForumPostType = Prisma.ForumGetPayload<{
include: {
// where: {
// id: string;
// };
author: {
select: {
name: true;
username: true;
image: true;
likes:
| {
// where: { id: string };
select: {
id: true;
};
}
| false;
_count: {
select: {
likes: true;
};
};
};
};
};
}>;then i get this for
likeslikes field below, instead of | undefined| undefined or something. am i doing it wrong?type ForumPostType = {
author: {
name: string;
username: string | null;
image: string | null;
likes: {
id: string;
createdAt: Date;
userId: string;
forumId: string;
}[];
_count: {
likes: number;
};
};
} & {
id: string;
... 4 more ...;
updatedAt: Date;
}type ForumPostType = {
author: {
name: string;
username: string | null;
image: string | null;
likes: {
id: string;
createdAt: Date;
userId: string;
forumId: string;
}[];
_count: {
likes: number;
};
};
} & {
id: string;
... 4 more ...;
updatedAt: Date;
}