{
twitter: {
card: "summary_large_image",
title: `${mii.name} - TomodachiShare`,
- description: `Check out '${mii.name}', a ${mii.platform === MiiPlatform.SWITCH ? "Switch Living the Dream" : "3DS"} Tomodachi Life Mii created by ${mii.name} on TomodachiShare with ${mii._count.likedBy} likes.`,
+ description: `Check out '${mii.name}', a ${mii.platform === MiiPlatform.SWITCH ? "Switch Living the Dream" : "3DS"} Tomodachi Life Mii created by ${mii.name} on TomodachiShare with ${mii.likeCount} likes.`,
images: [
{
url: metadataImageUrl,
@@ -306,7 +306,7 @@ export default async function MiiPage({ params }: Props) {
{/* Submission name */}
{mii.name}
{/* Like button */}
-
+
{/* Tags */}
diff --git a/src/app/report/mii/[id]/page.tsx b/src/app/report/mii/[id]/page.tsx
index da40d1a..86b8211 100644
--- a/src/app/report/mii/[id]/page.tsx
+++ b/src/app/report/mii/[id]/page.tsx
@@ -41,7 +41,7 @@ export default async function ReportMiiPage({ params }: Props) {
return (
-
+
);
}
diff --git a/src/components/mii/author-buttons.tsx b/src/components/mii/author-buttons.tsx
index 1a9414b..9555c7f 100644
--- a/src/components/mii/author-buttons.tsx
+++ b/src/components/mii/author-buttons.tsx
@@ -31,7 +31,7 @@ export default function AuthorButtons({ mii }: Props) {
Edit
-
+
>
);
}
diff --git a/src/components/mii/list/index.tsx b/src/components/mii/list/index.tsx
index 33042eb..0043cab 100644
--- a/src/components/mii/list/index.tsx
+++ b/src/components/mii/list/index.tsx
@@ -89,6 +89,7 @@ export default async function MiiList({ searchParams, userId, parentPage }: Prop
allowedCopying: true,
quarantined: true,
in_queue: true,
+ likeCount: true,
// Mii liked check
...(session?.user?.id && {
likedBy: {
@@ -96,10 +97,6 @@ export default async function MiiList({ searchParams, userId, parentPage }: Prop
select: { userId: true },
},
}),
- // Like count
- _count: {
- select: { likedBy: true },
- },
};
const skip = (page - 1) * limit;
@@ -111,7 +108,7 @@ export default async function MiiList({ searchParams, userId, parentPage }: Prop
let orderBy: Prisma.MiiOrderByWithRelationInput[];
if (sort === "likes") {
- orderBy = [{ likedBy: { _count: "desc" } }, { name: "asc" }];
+ orderBy = [{ likeCount: "desc" }, { name: "asc" }];
} else if (sort === "oldest") {
orderBy = [{ createdAt: "asc" }, { name: "asc" }];
} else {
diff --git a/src/components/mii/list/mii-grid.tsx b/src/components/mii/list/mii-grid.tsx
index 4dc6f54..0a07e13 100644
--- a/src/components/mii/list/mii-grid.tsx
+++ b/src/components/mii/list/mii-grid.tsx
@@ -74,7 +74,7 @@ export default function MiiGrid({ miis, userId, parentPage }: Props) {
-
+
{!userId && (
@@ -87,7 +87,7 @@ export default function MiiGrid({ miis, userId, parentPage }: Props) {
-
+
)}
@@ -105,7 +105,7 @@ export default function MiiGrid({ miis, userId, parentPage }: Props) {
-
+