trust roadmap

This commit is contained in:
arifal
2026-05-09 00:55:40 +07:00
parent 5e0232d909
commit 54cd984a7e
14 changed files with 628 additions and 281 deletions
+20
View File
@@ -23,4 +23,24 @@ export const reviewRepo = {
},
});
},
/**
* Semua review untuk trip yang di-host organizer ini, terbaru di depan.
* Dipakai di profil publik organizer untuk menampilkan testimoni.
*/
async findByOrganizer(organizerId: string, limit = 20) {
return prisma.tripReview.findMany({
where: { trip: { organizerId } },
orderBy: { createdAt: "desc" },
take: limit,
select: {
id: true,
rating: true,
comment: true,
createdAt: true,
user: { select: { id: true, name: true, image: true } },
trip: { select: { id: true, title: true, destination: true } },
},
});
},
};