fix: admin app info

deskripsi:
- penerapan filter jenis kelamin pada forum
This commit is contained in:
2025-05-19 17:42:42 +08:00
parent 0cbcee87bd
commit 117dbe6157
12 changed files with 139 additions and 133 deletions

View File

@@ -82,16 +82,7 @@ async function GET(request: Request) {
const data = await prisma.sticker.findMany({
skip: dataSkip,
take: dataTake,
where: {
MasterEmotions: {
some: {
value: {
contains: search ? search : "",
mode: "insensitive",
},
},
},
},
orderBy: {
createdAt: "desc",
},
@@ -100,18 +91,7 @@ async function GET(request: Request) {
},
});
const nCount = await prisma.sticker.count({
where: {
MasterEmotions: {
some: {
value: {
contains: search ? search : "",
mode: "insensitive",
},
},
},
},
});
const nCount = await prisma.sticker.count({});
fixData = {
data: data,

View File

@@ -15,7 +15,7 @@ async function GET(request: Request) {
let fixData;
const { searchParams } = new URL(request.url);
const emotion = searchParams.get("emotion");
const gender = searchParams.get("gender");
const page = searchParams.get("page");
const dataTake = 10;
const dataSkip = Number(page) * dataTake - dataTake;
@@ -29,13 +29,9 @@ async function GET(request: Request) {
},
where: {
isActive: true,
MasterEmotions: {
some: {
value: {
contains: emotion ? emotion : "",
mode: "insensitive",
},
},
jenisKelamin: {
mode: "insensitive",
contains: gender ?? "",
},
},
include: {
@@ -53,13 +49,9 @@ async function GET(request: Request) {
take: dataTake,
where: {
isActive: true,
MasterEmotions: {
some: {
value: {
contains: emotion ? emotion : "",
mode: "insensitive",
},
},
jenisKelamin: {
mode: "insensitive",
contains: gender ?? "",
},
},
orderBy: {
@@ -73,13 +65,9 @@ async function GET(request: Request) {
const nCount = await prisma.sticker.count({
where: {
isActive: true,
MasterEmotions: {
some: {
value: {
contains: emotion ? emotion : "",
mode: "insensitive",
},
},
jenisKelamin: {
mode: "insensitive",
contains: gender ?? "",
},
},
});

View File

@@ -1,14 +1,16 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Forum_Create } from "@/app_modules/forum";
import Forum_NewCreate from "@/app_modules/forum/create/new_create";
import { Forum_V3_Create } from "@/app_modules/forum/create/V3_create";
export default async function Page() {
const userLoginId = await funGetUserIdByToken();
return (
<>
{/* <Forum_Create /> */}
{/* <Forum_NewCreate/> */}
<Forum_V3_Create/>
<Forum_V3_Create userLoginId={userLoginId as string}/>
</>
);
}

View File

@@ -1,11 +1,13 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Forum_EditPosting } from "@/app_modules/forum";
import Forum_V3_EditPosting from "@/app_modules/forum/edit/posting/V3_edit_posting";
export default async function Page() {
const userLoginId = await funGetUserIdByToken();
return (
<>
{/* <Forum_EditPosting /> */}
<Forum_V3_EditPosting/>
<Forum_V3_EditPosting userLoginId={userLoginId as string}/>
</>
);
}