bug fixed
This commit is contained in:
parent
6252b61b89
commit
392d98f090
|
@ -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();
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ export default async function getCollectionById(
|
|||
_count: {
|
||||
select: { links: true },
|
||||
},
|
||||
subCollections: true,
|
||||
members: {
|
||||
include: {
|
||||
user: {
|
||||
|
|
|
@ -75,7 +75,6 @@ export default async function updateCollection(
|
|||
_count: {
|
||||
select: { links: true },
|
||||
},
|
||||
subCollections: true,
|
||||
members: {
|
||||
include: {
|
||||
user: {
|
||||
|
|
|
@ -12,7 +12,6 @@ export default async function getCollection(userId: number) {
|
|||
_count: {
|
||||
select: { links: true },
|
||||
},
|
||||
subCollections: true,
|
||||
members: {
|
||||
include: {
|
||||
user: {
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -35,7 +35,6 @@ export interface CollectionIncludingMembersAndLinkCount
|
|||
createdAt?: string;
|
||||
_count?: { links: number };
|
||||
members: Member[];
|
||||
subCollections: CollectionIncludingMembersAndLinkCount[];
|
||||
}
|
||||
|
||||
export interface TagIncludingLinkCount extends Tag {
|
||||
|
|
Ŝarĝante…
Reference in New Issue