upd: api mobile status saat error

This commit is contained in:
2025-10-16 14:53:23 +08:00
parent 1b8bfebf4f
commit ed2c9495c3
14 changed files with 34 additions and 33 deletions

View File

@@ -12,7 +12,7 @@ export async function GET(request: Request, context: { params: { id: string } })
const userMobile = searchParams.get("user")
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 { id } = context.params;
@@ -28,7 +28,7 @@ export async function GET(request: Request, context: { params: { id: string } })
success: false,
message: "Gagal mendapatkan grup, data tidak ditemukan",
},
{ status: 404 }
{ status: 200 }
);
}
@@ -52,7 +52,7 @@ export async function DELETE(request: Request, context: { params: { id: string }
const { isActive, user } = (await request.json());
if (user == "null" || user == undefined || user == "") {
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 userLogin = await funGetUserById({ id: user })
@@ -68,7 +68,7 @@ export async function DELETE(request: Request, context: { params: { id: string }
success: false,
message: "Edit grup gagal, data tidak ditemukan",
},
{ status: 404 }
{ status: 200 }
);
}
@@ -98,7 +98,7 @@ export async function PUT(request: Request, context: { params: { id: string } })
const { name, user } = (await request.json());
if (user == "null" || user == undefined || user == "") {
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 data = await prisma.group.count({
@@ -113,7 +113,7 @@ export async function PUT(request: Request, context: { params: { id: string } })
success: false,
message: "Edit grup gagal, data tidak ditemukan",
},
{ status: 404 }
{ status: 200 }
);
}

View File

@@ -11,7 +11,7 @@ export async function GET(request: Request) {
const userMobile = searchParams.get("user")
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 })
@@ -51,7 +51,7 @@ export async function POST(request: Request) {
const { name, user } = (await request.json());
if (user == "null" || user == undefined || user == "") {
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 userMobile = await funGetUserById({ id: user })