bug fixed

This commit is contained in:
daniel31x13 2024-02-06 07:46:57 -05:00
parent 6252b61b89
commit 392d98f090
6 changed files with 3 additions and 10 deletions

View File

@ -55,8 +55,7 @@ const CollectionItem = ({
active: string;
collections: CollectionIncludingMembersAndLinkCount[];
}) => {
const hasChildren =
collection.subCollections && collection.subCollections.length > 0;
const hasChildren = collections.some((e) => e.parentId === collection.id);
const router = useRouter();

View File

@ -16,7 +16,6 @@ export default async function getCollectionById(
_count: {
select: { links: true },
},
subCollections: true,
members: {
include: {
user: {

View File

@ -75,7 +75,6 @@ export default async function updateCollection(
_count: {
select: { links: true },
},
subCollections: true,
members: {
include: {
user: {

View File

@ -12,7 +12,6 @@ export default async function getCollection(userId: number) {
_count: {
select: { links: true },
},
subCollections: true,
members: {
include: {
user: {

View File

@ -124,8 +124,7 @@ export default function Index() {
</p>
</div>
{activeCollection.subCollections &&
activeCollection.subCollections.length > 0 ? (
{collections.some((e) => e.parentId === activeCollection.id) ? (
<details className="mt-2 mb-2">
<summary className="text-sm cursor-pointer select-none">
View Sub-Collections
@ -260,8 +259,7 @@ export default function Index() {
<p>{activeCollection?.description}</p>
) : undefined}
{/* {activeCollection?.subCollections &&
activeCollection?.subCollections.length > 0 ? (
{/* {collections.some((e) => e.parentId === activeCollection.id) ? (
<fieldset className="border rounded-md p-2 border-neutral-content">
<legend className="text-sm ml-2">Sub-Collections</legend>
<div className="flex gap-3">

View File

@ -35,7 +35,6 @@ export interface CollectionIncludingMembersAndLinkCount
createdAt?: string;
_count?: { links: number };
members: Member[];
subCollections: CollectionIncludingMembersAndLinkCount[];
}
export interface TagIncludingLinkCount extends Tag {