Query for reviews and users

app-store-improvements
Joe Au-Yeung 2022-05-25 10:18:15 -04:00
parent d6e9bfbe9f
commit ee9bde6d5b
1 changed files with 13 additions and 0 deletions

View File

@ -84,7 +84,20 @@ export const getStaticProps = async (ctx: GetStaticPropsContext) => {
const app = await prisma.app.findUnique({
where: { slug: ctx.params.slug },
include: {
reviews: {
select: {
user: {
select: {
name: true,
avatar: true,
},
},
},
},
},
});
console.log("🚀 ~ file: index.tsx ~ line 100 ~ getStaticProps ~ app", app.reviews);
if (!app) return { notFound: true };