Compare commits
15 Commits
fix-mobile
...
v1.5.19
| Author | SHA1 | Date | |
|---|---|---|---|
| ad91a48d82 | |||
| a06036cab7 | |||
| c3d8ccd490 | |||
| ba6a83f61d | |||
| dc05c4ef7e | |||
| d56a00a92b | |||
| 43deddca43 | |||
| 1e647c0391 | |||
| 94dc780ead | |||
| c710ca60b7 | |||
| 4164092100 | |||
| b118a6425c | |||
| 09e1f702e1 | |||
| ba5620bcc5 | |||
| 24e6fcd0f7 |
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.5.19](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.18...v1.5.19) (2025-12-01)
|
||||||
|
|
||||||
|
## [1.5.18](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.17...v1.5.18) (2025-11-28)
|
||||||
|
|
||||||
## [1.5.17](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.16...v1.5.17) (2025-11-24)
|
## [1.5.17](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.16...v1.5.17) (2025-11-24)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.5.17",
|
"version": "1.5.19",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "bun prisma/seed.ts"
|
"seed": "bun prisma/seed.ts"
|
||||||
|
|||||||
78
src/app/api/mobile/block-user/[id]/route.tsx
Normal file
78
src/app/api/mobile/block-user/[id]/route.tsx
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export { GET, DELETE };
|
||||||
|
|
||||||
|
async function GET(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
console.log("[ID] >>", id);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await prisma.blockedUser.findUnique({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
blocked: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
menuFeature: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 200,
|
||||||
|
success: true,
|
||||||
|
message: "success",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR GET BLOCK USER] >>", error);
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 500,
|
||||||
|
success: false,
|
||||||
|
message: "error",
|
||||||
|
reason: (error as Error).message || error,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function DELETE(request: Request, { params }: { params: { id: string } }) {
|
||||||
|
const { id } = params;
|
||||||
|
console.log("[ID] >>", id);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await prisma.blockedUser.delete({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 200,
|
||||||
|
success: true,
|
||||||
|
message: "success",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR DELETE BLOCK USER] >>", error);
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 500,
|
||||||
|
success: false,
|
||||||
|
message: "error",
|
||||||
|
reason: (error as Error).message || error,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ import _ from "lodash";
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import prisma from "@/lib/prisma";
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
export { POST };
|
export { POST, GET };
|
||||||
|
|
||||||
async function POST(request: Request) {
|
async function POST(request: Request) {
|
||||||
const { data } = await request.json();
|
const { data } = await request.json();
|
||||||
@@ -45,3 +45,65 @@ async function POST(request: Request) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function GET(request: Request) {
|
||||||
|
const { searchParams } = new URL(request.url);
|
||||||
|
const id = searchParams.get("id");
|
||||||
|
const page = Number(searchParams.get("page"));
|
||||||
|
const search = searchParams.get("search");
|
||||||
|
|
||||||
|
const takeData = 10;
|
||||||
|
const skipData = page * takeData - takeData;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const data = await prisma.blockedUser.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
where: {
|
||||||
|
blockerId: id as any,
|
||||||
|
menuFeature: {
|
||||||
|
id: {
|
||||||
|
contains: search || "",
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
blocked: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
menuFeature: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 200,
|
||||||
|
success: true,
|
||||||
|
message: "success",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR GET BLOCK USER] >>", error);
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 500,
|
||||||
|
success: false,
|
||||||
|
message: "error",
|
||||||
|
reason: (error as Error).message || error,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "bagas_admin",
|
"name": "default_user",
|
||||||
"nomor": "6282340374412",
|
"nomor": "6282340374412",
|
||||||
|
"masterUserRoleId": "1",
|
||||||
|
"active": true,
|
||||||
|
"termsOfServiceAccepted": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "admin_911",
|
||||||
|
"nomor": "6281339158911",
|
||||||
"masterUserRoleId": "3",
|
"masterUserRoleId": "3",
|
||||||
"active": true,
|
"active": true,
|
||||||
"termsOfServiceAccepted": true
|
"termsOfServiceAccepted": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fahmi_admin",
|
"name": "fahmi_admin",
|
||||||
"nomor": "628123833845",
|
"nomor": "628123833845",
|
||||||
"masterUserRoleId": "2",
|
"masterUserRoleId": "2",
|
||||||
"active": true,
|
"active": true,
|
||||||
"termsOfServiceAccepted": true
|
"termsOfServiceAccepted": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user