# fix
- authentication
- profile
- pencarian user
- forum
## No issue
This commit is contained in:
2024-05-20 10:55:13 +08:00
parent 66b9902d97
commit dbeb740d1f
58 changed files with 1374 additions and 386 deletions

View File

@@ -37,11 +37,6 @@ export async function forum_getListAllPosting() {
},
},
ForumMaster_StatusPosting: true,
// _count: {
// select: {
// Forum_Komentar: true,
// },
// },
},
});

View File

@@ -1,50 +1,51 @@
"use server"
"use server";
import prisma from "@/app/lib/prisma";
import _ from "lodash"
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,
},
});
export async function forum_funSearchListPosting(text: string) {
const get = await prisma.forum_Posting.findMany({
orderBy: [
// {
// forumMaster_StatusPostingId: "asc",
// },
{
createdAt: "desc",
},
],
take: 10,
where: {
isActive: true,
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,
}));
const data = get.map((val) => ({
..._.omit(val, ["Forum_Komentar"]),
_count: val.Forum_Komentar.length,
}));
return data;
}
return data;
}