- Tampilan admin untuk komentar
- Hapus komentar
- Hapus postingan
- Lihat report
- Search topik forum
## feat
### No issue
This commit is contained in:
2024-03-25 17:44:27 +08:00
parent de0790aade
commit 8af6c6265f
55 changed files with 2213 additions and 218 deletions

View File

@@ -0,0 +1,50 @@
"use server"
import prisma from "@/app/lib/prisma";
import _ from "lodash"
export async function forum_funSearchListPosting(text:string) {
const get = await prisma.forum_Posting.findMany({
orderBy: [
// {
// forumMaster_StatusPostingId: "asc",
// },
{
createdAt: "desc",
},
],
take: 10,
where: {
diskusi: {
contains: text,
mode: "insensitive",
},
},
select: {
id: true,
diskusi: true,
createdAt: true,
isActive: true,
authorId: true,
Author: {
select: {
id: true,
Profile: true,
},
},
Forum_Komentar: {
where: {
isActive: true,
},
},
ForumMaster_StatusPosting: true,
},
});
const data = get.map((val) => ({
..._.omit(val, ["Forum_Komentar"]),
_count: val.Forum_Komentar.length,
}));
return data;
}