Compare commits
2 Commits
qc-mobile/
...
qc-mobile/
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ee0b98f07 | |||
| cc78d82ca4 |
@@ -2,6 +2,8 @@
|
||||
|
||||
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.24](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.22...v1.5.24) (2025-12-08)
|
||||
|
||||
## [1.5.22](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.21...v1.5.22) (2025-12-03)
|
||||
|
||||
## [1.5.21](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.20...v1.5.21) (2025-12-03)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hipmi",
|
||||
"version": "1.5.23",
|
||||
"version": "1.5.24",
|
||||
"private": true,
|
||||
"prisma": {
|
||||
"seed": "bun prisma/seed.ts"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "User" ADD COLUMN "acceptedForumTermsAt" TIMESTAMP(3),
|
||||
ADD COLUMN "acceptedTermsAt" TIMESTAMP(3);
|
||||
@@ -55,6 +55,9 @@ model User {
|
||||
|
||||
blockedUsers BlockedUser[] @relation("Blocking")
|
||||
blockedBy BlockedUser[] @relation("BlockedBy")
|
||||
|
||||
acceptedTermsAt DateTime?
|
||||
acceptedForumTermsAt DateTime?
|
||||
}
|
||||
|
||||
model MasterUserRole {
|
||||
|
||||
1098
prisma/schema.prisma.backup
Normal file
1098
prisma/schema.prisma.backup
Normal file
File diff suppressed because it is too large
Load Diff
@@ -41,6 +41,7 @@ export async function POST(req: Request) {
|
||||
nomor: data.nomor,
|
||||
active: false,
|
||||
termsOfServiceAccepted: data.termsOfServiceAccepted,
|
||||
acceptedTermsAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ async function POST(request: Request, { params }: { params: { id: string } }) {
|
||||
|
||||
const msg = `Report Komentar: "${content?.komentar}" dengan kategori \n\n\n${reportList?.title} : \n\n${reportList?.deskripsi}`;
|
||||
const res = await fetch(
|
||||
`https://wa.wibudev.com/code?nom=6282340374412&text=${msg}`,
|
||||
`https://cld-dkr-prod-wajs-server.wibudev.com/api/wa/code?nom=6282340374412&text=${msg}`,
|
||||
{ cache: "no-cache" }
|
||||
);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ async function POST(request: Request, { params }: { params: { id: string } }) {
|
||||
|
||||
const msg = `Report Postingan: "${content?.diskusi}"`;
|
||||
const res = await fetch(
|
||||
`https://wa.wibudev.com/code?nom=6282340374412&text=${msg}`,
|
||||
`https://cld-dkr-prod-wajs-server.wibudev.com/api/wa/code?nom=6282340374412&text=${msg}`,
|
||||
{ cache: "no-cache" }
|
||||
);
|
||||
|
||||
|
||||
68
src/app/api/mobile/user/[id]/terms-of-app/route.ts
Normal file
68
src/app/api/mobile/user/[id]/terms-of-app/route.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { prisma } from "@/lib";
|
||||
|
||||
export { POST };
|
||||
|
||||
async function POST(request: Request, { params }: { params: { id: string } }) {
|
||||
const { id } = params;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const category = searchParams.get("category");
|
||||
|
||||
console.log("[ID USER", id);
|
||||
console.log("[SEARCH PARAMS", category);
|
||||
|
||||
try {
|
||||
const user = await prisma.user.findUnique({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "User not found",
|
||||
},
|
||||
{ status: 404 }
|
||||
);
|
||||
}
|
||||
|
||||
const updateUser = await prisma.user.update({
|
||||
where: {
|
||||
id: id,
|
||||
},
|
||||
data: {
|
||||
acceptedForumTermsAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
if (!updateUser) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Gagal mengupdate data",
|
||||
},
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: true,
|
||||
message: "Syarat dan Ketentuan berhasil diterima",
|
||||
},
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
message: "Error update data from API ",
|
||||
reason: (error as Error).message,
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user