trust roadmap
This commit is contained in:
@@ -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 } },
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user