Merge pull request #457 from bipproduction/amalia/11-jun-25

upd: api mobile
This commit is contained in:
Amalia
2025-06-11 17:30:36 +08:00
committed by GitHub
3 changed files with 6 additions and 8 deletions

View File

@@ -80,8 +80,8 @@ export async function GET(request: Request) {
const announcements = await prisma.announcement.findMany({
// skip: dataSkip,
// take: 10,
skip: dataSkip,
take: 10,
where: kondisi,
select: {
id: true,

View File

@@ -45,8 +45,8 @@ export async function GET(request: Request) {
}
const data = await prisma.discussion.findMany({
// skip: dataSkip,
// take: 10,
skip: dataSkip,
take: 10,
where: {
isActive: status == "false" ? false : true,
idVillage: String(villageId),

View File

@@ -18,7 +18,7 @@ export async function GET(request: Request) {
const dataSkip = Number(page) * 10 - 10;
if (userMobile == "null" || userMobile == undefined || userMobile == "") {
return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 401 });
return NextResponse.json({ success: false, message: "Anda harus login untuk mengakses ini" }, { status: 200 });
}
const user = await funGetUserById({ id: userMobile })
@@ -39,9 +39,7 @@ export async function GET(request: Request) {
}
})
if (page != undefined) {
if (page != "undefined" && page != "null" && page != "" && page!=undefined && page!=null) {
const users = await prisma.user.findMany({
skip: dataSkip,
take: 10,