Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad91a48d82 | |||
| a06036cab7 | |||
| c3d8ccd490 | |||
| ba6a83f61d | |||
| dc05c4ef7e | |||
| d56a00a92b | |||
| 43deddca43 | |||
| 1e647c0391 | |||
| 6f10ff7c3e | |||
| 09be7739d5 | |||
| 38734cda8c | |||
| 94dc780ead | |||
| fb9515dfe4 | |||
| 0b3d4830f9 | |||
| c710ca60b7 | |||
| 94e4b884a7 | |||
| 4164092100 | |||
| fcad857422 | |||
| 32619ee9b3 | |||
| b118a6425c | |||
| 09e1f702e1 | |||
| ba5620bcc5 | |||
| 24e6fcd0f7 |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -2,6 +2,21 @@
|
|||||||
|
|
||||||
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)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* delete all data user ([fb9515d](https://wibugit.wibudev.com/wibu/hipmi/commit/fb9515dfe465ef07d43460ca4e9bb31705ec48b8))
|
||||||
|
|
||||||
|
## [1.5.16](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.15...v1.5.16) (2025-11-20)
|
||||||
|
|
||||||
|
## [1.5.15](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.14...v1.5.15) (2025-11-18)
|
||||||
|
|
||||||
## [1.5.14](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.13...v1.5.14) (2025-11-17)
|
## [1.5.14](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.13...v1.5.14) (2025-11-17)
|
||||||
|
|
||||||
## [1.5.13](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.12...v1.5.13) (2025-11-17)
|
## [1.5.13](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.5.12...v1.5.13) (2025-11-17)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.5.14",
|
"version": "1.5.19",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "bun prisma/seed.ts"
|
"seed": "bun prisma/seed.ts"
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Donasi_Invoice" ALTER COLUMN "masterBankId" SET DEFAULT 'null';
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "User" ADD COLUMN "termsOfServiceAccepted" BOOLEAN NOT NULL DEFAULT false;
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "BlockedUser" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"isActive" BOOLEAN NOT NULL DEFAULT true,
|
||||||
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||||
|
"blockerId" TEXT NOT NULL,
|
||||||
|
"blockedId" TEXT NOT NULL,
|
||||||
|
"menuFeatureId" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "BlockedUser_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "MenuFeature" (
|
||||||
|
"id" TEXT NOT NULL,
|
||||||
|
"isActive" BOOLEAN NOT NULL DEFAULT true,
|
||||||
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||||
|
"name" TEXT NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT "MenuFeature_pkey" PRIMARY KEY ("id")
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "BlockedUser_blockerId_blockedId_key" ON "BlockedUser"("blockerId", "blockedId");
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "BlockedUser" ADD CONSTRAINT "BlockedUser_menuFeatureId_fkey" FOREIGN KEY ("menuFeatureId") REFERENCES "MenuFeature"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "BlockedUser" ADD CONSTRAINT "BlockedUser_blockerId_fkey" FOREIGN KEY ("blockerId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "BlockedUser" ADD CONSTRAINT "BlockedUser_blockedId_fkey" FOREIGN KEY ("blockedId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to drop the `MenuFeature` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "BlockedUser" DROP CONSTRAINT "BlockedUser_menuFeatureId_fkey";
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE "MenuFeature";
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "BlockedUser" ADD CONSTRAINT "BlockedUser_menuFeatureId_fkey" FOREIGN KEY ("menuFeatureId") REFERENCES "MasterKategoriApp"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
@@ -49,8 +49,12 @@ model User {
|
|||||||
BusinessMaps BusinessMaps[]
|
BusinessMaps BusinessMaps[]
|
||||||
Investasi_Invoice Investasi_Invoice[]
|
Investasi_Invoice Investasi_Invoice[]
|
||||||
|
|
||||||
EventSponsor EventSponsor[]
|
EventSponsor EventSponsor[]
|
||||||
EventTransaksi EventTransaksi[]
|
EventTransaksi EventTransaksi[]
|
||||||
|
termsOfServiceAccepted Boolean @default(false)
|
||||||
|
|
||||||
|
blockedUsers BlockedUser[] @relation("Blocking")
|
||||||
|
blockedBy BlockedUser[] @relation("BlockedBy")
|
||||||
}
|
}
|
||||||
|
|
||||||
model MasterUserRole {
|
model MasterUserRole {
|
||||||
@@ -1011,6 +1015,8 @@ model MasterKategoriApp {
|
|||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
name String
|
name String
|
||||||
value String?
|
value String?
|
||||||
|
|
||||||
|
blockedUsers BlockedUser[]
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================= EVENT ======================= //
|
// ======================= EVENT ======================= //
|
||||||
@@ -1073,3 +1079,20 @@ model Sticker {
|
|||||||
|
|
||||||
MasterEmotions MasterEmotions[] @relation("StikerEmotions")
|
MasterEmotions MasterEmotions[] @relation("StikerEmotions")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model BlockedUser {
|
||||||
|
id String @id @default(uuid())
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
blockerId String // ID user yang memblokir
|
||||||
|
blockedId String // ID user yang diblokir
|
||||||
|
|
||||||
|
menuFeatureId String
|
||||||
|
menuFeature MasterKategoriApp @relation(fields: [menuFeatureId], references: [id])
|
||||||
|
|
||||||
|
blocker User @relation("BlockedBy", fields: [blockerId], references: [id])
|
||||||
|
blocked User @relation("Blocking", fields: [blockedId], references: [id])
|
||||||
|
|
||||||
|
@@unique([blockerId, blockedId])
|
||||||
|
}
|
||||||
|
|||||||
110
public/terms-of-service.html
Normal file
110
public/terms-of-service.html
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="id">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
|
<title>Syarat & Ketentuan - HIPMI Badung Connect</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #333;
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 40px auto;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
h1, h2, h3 {
|
||||||
|
color: #1a365d;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
footer {
|
||||||
|
margin-top: 40px;
|
||||||
|
font-size: 0.9em;
|
||||||
|
color: #666;
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Syarat & Ketentuan Penggunaan HIPMI Badung Connect</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Dengan menggunakan aplikasi <strong>HIPMI Badung Connect</strong> (“Aplikasi”), Anda setuju untuk mematuhi dan terikat oleh syarat dan ketentuan berikut. Jika Anda tidak setuju dengan ketentuan ini, harap jangan gunakan Aplikasi.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>1. Definisi</h2>
|
||||||
|
<p>
|
||||||
|
<strong>HIPMI Badung Connect</strong> adalah platform digital resmi untuk anggota Himpunan Pengusaha Muda Indonesia (HIPMI) Kabupaten Badung, yang bertujuan memfasilitasi jaringan, kolaborasi, dan pertumbuhan bisnis para pengusaha muda.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>2. Larangan Konten Tidak Pantas</h2>
|
||||||
|
<p>
|
||||||
|
Anda <strong>dilarang keras</strong> memposting, mengirim, membagikan, atau mengunggah konten apa pun yang mengandung:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Ujaran kebencian, diskriminasi, atau konten SARA (Suku, Agama, Ras, Antar-golongan)</li>
|
||||||
|
<li>Pornografi, konten seksual eksplisit, atau gambar tidak senonoh</li>
|
||||||
|
<li>Ancaman, pelecehan, bullying, atau perilaku melecehkan</li>
|
||||||
|
<li>Informasi palsu, hoaks, spam, atau konten menyesatkan</li>
|
||||||
|
<li>Konten ilegal, melanggar hukum, atau melanggar hak kekayaan intelektual pihak lain</li>
|
||||||
|
<li>Promosi narkoba, perjudian, atau aktivitas ilegal lainnya</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>3. Tanggung Jawab Pengguna</h2>
|
||||||
|
<p>
|
||||||
|
Anda bertanggung jawab penuh atas setiap konten yang Anda unggah atau bagikan melalui fitur-fitur berikut:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Profil (bio, foto, portofolio)</li>
|
||||||
|
<li>Forum diskusi</li>
|
||||||
|
<li>Chat pribadi atau grup</li>
|
||||||
|
<li>Lowongan kerja, investasi, dan donasi</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Konten yang melanggar ketentuan ini dapat dihapus kapan saja tanpa pemberitahuan.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>4. Tindakan terhadap Pelanggaran</h2>
|
||||||
|
<p>
|
||||||
|
Jika kami menerima laporan atau menemukan konten yang melanggar ketentuan ini, kami akan:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Segera menghapus konten tersebut</li>
|
||||||
|
<li>Memberikan peringatan atau memblokir akun pengguna</li>
|
||||||
|
<li>Dalam kasus berat, melaporkan ke pihak berwajib sesuai hukum yang berlaku</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Tim kami berkomitmen untuk menanggapi laporan konten tidak pantas <strong>dalam waktu 24 jam</strong>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>5. Mekanisme Pelaporan</h2>
|
||||||
|
<p>
|
||||||
|
Anda dapat melaporkan konten atau pengguna yang mencurigakan melalui:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Tombol <strong>“Laporkan”</strong> di setiap posting forum atau pesan chat</li>
|
||||||
|
<li>Tombol <strong>“Blokir Pengguna”</strong> di profil pengguna</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Setiap laporan akan ditangani secara rahasia dan segera.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>6. Perubahan Ketentuan</h2>
|
||||||
|
<p>
|
||||||
|
Kami berhak memperbarui Syarat & Ketentuan ini sewaktu-waktu. Versi terbaru akan dipublikasikan di halaman ini dengan tanggal revisi yang diperbarui.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>7. Kontak</h2>
|
||||||
|
<p>
|
||||||
|
Jika Anda memiliki pertanyaan tentang ketentuan ini, silakan hubungi kami di:
|
||||||
|
<strong>bip.baliinteraktifperkasa@gmail.com</strong>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<p>© 2025 Bali Interaktif Perkasa. All rights reserved.</p>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -20,6 +20,7 @@ export default function DeleteAccount() {
|
|||||||
const [data, setData] = useState({
|
const [data, setData] = useState({
|
||||||
description: "",
|
description: "",
|
||||||
});
|
});
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Hanya di client, setelah mount
|
// Hanya di client, setelah mount
|
||||||
@@ -31,15 +32,32 @@ export default function DeleteAccount() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handlerSubmit = async () => {
|
const handlerSubmit = async () => {
|
||||||
if (!phoneNumber || !data.description) {
|
if (!phoneNumber) {
|
||||||
return notifications.show({
|
return notifications.show({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
message: "Please fill in description & phone number",
|
message: "Please check your phone number",
|
||||||
|
color: "red",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data.description) {
|
||||||
|
return notifications.show({
|
||||||
|
title: "Error",
|
||||||
|
message: "Please fill in description with 'Delete Account'",
|
||||||
|
color: "red",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.description !== "Delete Account") {
|
||||||
|
return notifications.show({
|
||||||
|
title: "Error",
|
||||||
|
message: "Please fill in description with 'Delete Account'",
|
||||||
color: "red",
|
color: "red",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
const response = await fetch("/api/helper/delete-account", {
|
const response = await fetch("/api/helper/delete-account", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -67,12 +85,14 @@ export default function DeleteAccount() {
|
|||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
notifications.show({
|
notifications.show({
|
||||||
title: "Error",
|
title: "Error",
|
||||||
message: result.error,
|
message: result.error || "Failed to delete account.",
|
||||||
color: "red",
|
color: "red",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -121,7 +141,7 @@ export default function DeleteAccount() {
|
|||||||
/>
|
/>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={4}>
|
<Grid.Col span={4}>
|
||||||
<Button onClick={handlerSubmit} w={"100%"}>
|
<Button onClick={handlerSubmit} w={"100%"} loading={isLoading}>
|
||||||
Submit
|
Submit
|
||||||
</Button>
|
</Button>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
Group,
|
Group,
|
||||||
Paper,
|
Paper,
|
||||||
SimpleGrid,
|
SimpleGrid,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
Textarea,
|
Textarea,
|
||||||
TextInput,
|
TextInput,
|
||||||
Title
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { notifications } from "@mantine/notifications";
|
import { notifications } from "@mantine/notifications";
|
||||||
import { IconBrandGmail, IconLocation } from "@tabler/icons-react";
|
import { IconBrandGmail, IconLocation } from "@tabler/icons-react";
|
||||||
@@ -22,6 +22,7 @@ export default function SupportCenter() {
|
|||||||
title: "",
|
title: "",
|
||||||
description: "",
|
description: "",
|
||||||
});
|
});
|
||||||
|
const [isLoading, setLoading] = useState(false);
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
if (!data.email || !data.title || !data.description) {
|
if (!data.email || !data.title || !data.description) {
|
||||||
@@ -32,35 +33,43 @@ export default function SupportCenter() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch("/api/helper/support-center", {
|
try {
|
||||||
method: "POST",
|
setLoading(true);
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
body: JSON.stringify(data),
|
|
||||||
});
|
|
||||||
const result = await response.json();
|
|
||||||
|
|
||||||
if (result.success) {
|
const response = await fetch("/api/helper/support-center", {
|
||||||
notifications.show({
|
method: "POST",
|
||||||
title: "Success",
|
headers: {
|
||||||
color: "green",
|
"Content-Type": "application/json",
|
||||||
message: "Message sent successfully.",
|
},
|
||||||
|
body: JSON.stringify(data),
|
||||||
});
|
});
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
setData({
|
if (result.success) {
|
||||||
email: "",
|
notifications.show({
|
||||||
title: "",
|
title: "Success",
|
||||||
description: "",
|
color: "green",
|
||||||
});
|
message: "Message sent successfully.",
|
||||||
}
|
});
|
||||||
|
|
||||||
if (!result.success) {
|
setData({
|
||||||
notifications.show({
|
email: "",
|
||||||
title: "Error",
|
title: "",
|
||||||
color: "red",
|
description: "",
|
||||||
message: result.error,
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
|
if (!result.success) {
|
||||||
|
notifications.show({
|
||||||
|
title: "Error",
|
||||||
|
color: "red",
|
||||||
|
message: result.error || "Failed to send message.",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -177,7 +186,11 @@ export default function SupportCenter() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button color="yellow" onClick={() => handleSubmit()}>
|
<Button
|
||||||
|
loading={isLoading}
|
||||||
|
color="yellow"
|
||||||
|
onClick={() => handleSubmit()}
|
||||||
|
>
|
||||||
Submit
|
Submit
|
||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ export async function POST(req: Request) {
|
|||||||
try {
|
try {
|
||||||
const { data } = await req.json();
|
const { data } = await req.json();
|
||||||
|
|
||||||
|
console.log("data >>", data);
|
||||||
|
|
||||||
const cekUsername = await prisma.user.findUnique({
|
const cekUsername = await prisma.user.findUnique({
|
||||||
where: {
|
where: {
|
||||||
username: data.username,
|
username: data.username,
|
||||||
@@ -26,11 +28,20 @@ export async function POST(req: Request) {
|
|||||||
message: "Username sudah digunakan",
|
message: "Username sudah digunakan",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ✅ Validasi wajib setuju Terms
|
||||||
|
if (data.termsOfServiceAccepted !== true) {
|
||||||
|
return NextResponse.json({
|
||||||
|
success: false,
|
||||||
|
message: "You must agree to the Terms of Service",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const createUser = await prisma.user.create({
|
const createUser = await prisma.user.create({
|
||||||
data: {
|
data: {
|
||||||
username: data.username,
|
username: data.username,
|
||||||
nomor: data.nomor,
|
nomor: data.nomor,
|
||||||
active: false,
|
active: false,
|
||||||
|
termsOfServiceAccepted: data.termsOfServiceAccepted,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -51,7 +62,7 @@ export async function POST(req: Request) {
|
|||||||
success: true,
|
success: true,
|
||||||
message: "Registrasi Berhasil, Anda Sedang Login",
|
message: "Registrasi Berhasil, Anda Sedang Login",
|
||||||
token: token,
|
token: token,
|
||||||
// data: createUser,
|
// data: createUser,x
|
||||||
},
|
},
|
||||||
{ status: 201 }
|
{ status: 201 }
|
||||||
);
|
);
|
||||||
@@ -65,7 +76,5 @@ export async function POST(req: Request) {
|
|||||||
},
|
},
|
||||||
{ status: 500 }
|
{ status: 500 }
|
||||||
);
|
);
|
||||||
} finally {
|
|
||||||
await prisma.$disconnect();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
29
src/app/api/auth/term-service/route.ts
Normal file
29
src/app/api/auth/term-service/route.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export async function POST(req: Request) {
|
||||||
|
try {
|
||||||
|
const { data } = await req.json();
|
||||||
|
console.log("data >>", data);
|
||||||
|
|
||||||
|
const updateTermService = await prisma.user.update({
|
||||||
|
where: {
|
||||||
|
id: data.id,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
termsOfServiceAccepted: data.termsOfServiceAccepted,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
success: true,
|
||||||
|
message: "Berhasil",
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.log("error >>", error);
|
||||||
|
return NextResponse.json({
|
||||||
|
success: false,
|
||||||
|
message: "Gagal",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@ export async function POST(req: Request) {
|
|||||||
username: true,
|
username: true,
|
||||||
active: true,
|
active: true,
|
||||||
masterUserRoleId: true,
|
masterUserRoleId: true,
|
||||||
|
termsOfServiceAccepted: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -52,6 +53,7 @@ export async function POST(req: Request) {
|
|||||||
message: "Berhasil Login",
|
message: "Berhasil Login",
|
||||||
roleId: dataUser.masterUserRoleId,
|
roleId: dataUser.masterUserRoleId,
|
||||||
active: dataUser.active,
|
active: dataUser.active,
|
||||||
|
termsOfServiceAccepted: dataUser.termsOfServiceAccepted,
|
||||||
token: token,
|
token: token,
|
||||||
},
|
},
|
||||||
{ status: 200 }
|
{ status: 200 }
|
||||||
@@ -76,7 +78,5 @@ export async function POST(req: Request) {
|
|||||||
},
|
},
|
||||||
{ status: 500 }
|
{ status: 500 }
|
||||||
);
|
);
|
||||||
} finally {
|
|
||||||
await prisma.$disconnect();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ export async function POST(req: Request) {
|
|||||||
|
|
||||||
const data = await resend.emails.send({
|
const data = await resend.emails.send({
|
||||||
from: `${email} <onboarding@resend.dev>`,
|
from: `${email} <onboarding@resend.dev>`,
|
||||||
to: ["bip.baliinteraktifperkasa@gmail.com"], // ganti sesuai email kamu
|
to: ["bagasbanuna02@gmail.com"],
|
||||||
|
// to: ["bip.baliinteraktifperkasa@gmail.com"],
|
||||||
subject: title,
|
subject: title,
|
||||||
html: `
|
html: `
|
||||||
<div style="font-family: Arial, sans-serif; font-size: 16px; color: #333;">
|
<div style="font-family: Arial, sans-serif; font-size: 16px; color: #333;">
|
||||||
|
|||||||
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
109
src/app/api/mobile/block-user/route.ts
Normal file
109
src/app/api/mobile/block-user/route.ts
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
import _ from "lodash";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export { POST, GET };
|
||||||
|
|
||||||
|
async function POST(request: Request) {
|
||||||
|
const { data } = await request.json();
|
||||||
|
|
||||||
|
console.log("data >>", data);
|
||||||
|
console.log("menuFeature masuk>>", data.menuFeature);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const nameApp = _.lowerCase(data.menuFeature);
|
||||||
|
const menuFeature = await prisma.masterKategoriApp.findFirst({
|
||||||
|
where: { value: nameApp },
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(" fix menuFeature >>", menuFeature);
|
||||||
|
|
||||||
|
const blockUser = await prisma.blockedUser.create({
|
||||||
|
data: {
|
||||||
|
blockerId: data.blockerId,
|
||||||
|
blockedId: data.blockedId,
|
||||||
|
menuFeatureId: menuFeature?.id as any,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 200,
|
||||||
|
success: true,
|
||||||
|
message: "success",
|
||||||
|
// data: blockUser,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR BLOCK USER] >>", error);
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 500,
|
||||||
|
success: false,
|
||||||
|
message: "error",
|
||||||
|
reason: (error as Error).message || error,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,6 +47,8 @@ async function POST(request: Request) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("[DATA DONASI]", dataDonasi);
|
||||||
|
|
||||||
if (!dataDonasi)
|
if (!dataDonasi)
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
status: 400,
|
status: 400,
|
||||||
@@ -68,6 +70,8 @@ async function POST(request: Request) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("[DATA CERITA]", dataCerita);
|
||||||
|
|
||||||
if (!dataCerita)
|
if (!dataCerita)
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
status: 400,
|
status: 400,
|
||||||
|
|||||||
@@ -36,11 +36,109 @@ async function GET(request: Request) {
|
|||||||
let fixData;
|
let fixData;
|
||||||
const { searchParams } = new URL(request.url);
|
const { searchParams } = new URL(request.url);
|
||||||
const authorId = searchParams.get("authorId");
|
const authorId = searchParams.get("authorId");
|
||||||
|
const userLoginId = searchParams.get("userLoginId");
|
||||||
const search = searchParams.get("search");
|
const search = searchParams.get("search");
|
||||||
|
const category = searchParams.get("category");
|
||||||
|
const page = searchParams.get("page");
|
||||||
|
const takeData = 5;
|
||||||
|
const skipData = (Number(page) - 1) * takeData;
|
||||||
|
|
||||||
|
|
||||||
|
// console.log("authorId", authorId);
|
||||||
|
// console.log("userLoginId", userLoginId);
|
||||||
|
// console.log("search", search);
|
||||||
|
// console.log("category", category);
|
||||||
|
console.log("page", page);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (authorId) {
|
if (category === "beranda") {
|
||||||
|
const blockUserId = await prisma.blockedUser
|
||||||
|
.findMany({
|
||||||
|
where: {
|
||||||
|
blockerId: userLoginId as string,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
blockedId: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
return res.map((item) => item.blockedId);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("blockUserId", blockUserId);
|
||||||
|
|
||||||
const data = await prisma.forum_Posting.findMany({
|
const data = await prisma.forum_Posting.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
isActive: true,
|
||||||
|
diskusi: {
|
||||||
|
mode: "insensitive",
|
||||||
|
contains: search || "",
|
||||||
|
},
|
||||||
|
authorId: {
|
||||||
|
notIn: blockUserId,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
diskusi: true,
|
||||||
|
createdAt: true,
|
||||||
|
isActive: true,
|
||||||
|
authorId: true,
|
||||||
|
Author: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
username: true,
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
name: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Forum_Komentar: {
|
||||||
|
where: {
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ForumMaster_StatusPosting: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
status: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
forumMaster_StatusPostingId: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const newData = data.map((item) => {
|
||||||
|
const count = item.Forum_Komentar?.length ?? 0;
|
||||||
|
return {
|
||||||
|
..._.omit(item, ["Forum_Komentar"]),
|
||||||
|
count,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
fixData = newData;
|
||||||
|
} else if (category === "forumku") {
|
||||||
|
|
||||||
|
const count = await prisma.forum_Posting.count({
|
||||||
|
where: {
|
||||||
|
isActive: true,
|
||||||
|
authorId: authorId,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const data = await prisma.forum_Posting.findMany({
|
||||||
|
take: page ? takeData : undefined,
|
||||||
|
skip: page ? skipData : undefined,
|
||||||
orderBy: {
|
orderBy: {
|
||||||
createdAt: "desc",
|
createdAt: "desc",
|
||||||
},
|
},
|
||||||
@@ -90,62 +188,18 @@ async function GET(request: Request) {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
fixData = newData;
|
const dataFix = {
|
||||||
|
data: newData,
|
||||||
|
count,
|
||||||
|
}
|
||||||
|
|
||||||
|
fixData = dataFix;
|
||||||
} else {
|
} else {
|
||||||
const data = await prisma.forum_Posting.findMany({
|
return NextResponse.json({
|
||||||
orderBy: {
|
success: false,
|
||||||
createdAt: "desc",
|
message: "Gagal mendapatkan data",
|
||||||
},
|
reason: "Kategori tidak ditemukan",
|
||||||
where: {
|
|
||||||
isActive: true,
|
|
||||||
diskusi: {
|
|
||||||
mode: "insensitive",
|
|
||||||
contains: search || "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
diskusi: true,
|
|
||||||
createdAt: true,
|
|
||||||
isActive: true,
|
|
||||||
authorId: true,
|
|
||||||
Author: {
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
username: true,
|
|
||||||
Profile: {
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
name: true,
|
|
||||||
imageId: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Forum_Komentar: {
|
|
||||||
where: {
|
|
||||||
isActive: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
ForumMaster_StatusPosting: {
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
status: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
forumMaster_StatusPostingId: true,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const newData = data.map((item) => {
|
|
||||||
const count = item.Forum_Komentar?.length ?? 0;
|
|
||||||
return {
|
|
||||||
..._.omit(item, ["Forum_Komentar"]),
|
|
||||||
count,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
fixData = newData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
@@ -153,7 +207,6 @@ async function GET(request: Request) {
|
|||||||
message: "Berhasil mendapatkan data",
|
message: "Berhasil mendapatkan data",
|
||||||
data: fixData,
|
data: fixData,
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("[ERROR]", error);
|
console.log("[ERROR]", error);
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
|
|||||||
28
src/app/api/mobile/master/app-category/route.ts
Normal file
28
src/app/api/mobile/master/app-category/route.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export { GET };
|
||||||
|
|
||||||
|
async function GET(request: Request) {
|
||||||
|
try {
|
||||||
|
const data = await prisma.masterKategoriApp.findMany({
|
||||||
|
where: {
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 200,
|
||||||
|
success: true,
|
||||||
|
message: "success",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR GET APP CATEGORY] >>", error);
|
||||||
|
return NextResponse.json({
|
||||||
|
status: 500,
|
||||||
|
success: false,
|
||||||
|
message: "error",
|
||||||
|
reason: (error as Error).message || error,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,3 +32,717 @@ export async function GET(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function DELETE(
|
||||||
|
request: Request,
|
||||||
|
{ params }: { params: { id: string } }
|
||||||
|
) {
|
||||||
|
const { id } = params;
|
||||||
|
console.log("[ID USER", id);
|
||||||
|
try {
|
||||||
|
console.log("[START DELETE ALL >>>]");
|
||||||
|
const checkUser = await prisma.user.findUnique({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
// EVENT START
|
||||||
|
Event: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Event_Peserta: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// EVENT END
|
||||||
|
|
||||||
|
// COLLABORATION START
|
||||||
|
ProjectCollaboration: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ProjectCollaboration_Partisipasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ProjectCollaboration_RoomChat: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ProjectCollaboration_AnggotaRoomChat: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ProjectCollaboration_Message: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// COLLABORATION END
|
||||||
|
|
||||||
|
// VOTING START
|
||||||
|
Voting: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
Voting_DaftarNamaVote: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Voting_Kontributor: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
// VOTING END
|
||||||
|
|
||||||
|
// JOB START
|
||||||
|
Job: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// JOB END
|
||||||
|
|
||||||
|
// FORUM START
|
||||||
|
Forum_Posting: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Forum_Komentar: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Forum_ReportKomentar: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Forum_ReportPosting: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// FORUM END
|
||||||
|
|
||||||
|
// INVITATION START
|
||||||
|
Investasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
prospektusFileId: true,
|
||||||
|
imageId: true,
|
||||||
|
BeritaInvestasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
DokumenInvestasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
fileId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
Investasi_Invoice: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
// INVITATION END
|
||||||
|
|
||||||
|
// DONATION START
|
||||||
|
Donasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
CeritaDonasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Donasi_Kabar: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Donasi_PencairanDana: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
Donasi_Invoice: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
// DONATION END
|
||||||
|
|
||||||
|
// PROFILE & PORTOFOLOIO START
|
||||||
|
Profile: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
Portofolio: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
logoId: true,
|
||||||
|
BusinessMaps: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
imageId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Portofolio_MediaSosial: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// PROFILE & PORTOFOLOIO END
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// =================================================== //
|
||||||
|
// ================ START DELETE ALL ================= //
|
||||||
|
// =================================================== //
|
||||||
|
|
||||||
|
// EVENT DELETE START
|
||||||
|
for (let event of checkUser?.Event_Peserta as any) {
|
||||||
|
const deleteEvent = await prisma.event_Peserta.delete({
|
||||||
|
where: {
|
||||||
|
id: event.id,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
Event: {
|
||||||
|
select: {
|
||||||
|
title: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE EVENT PESERTA", deleteEvent]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let event of checkUser?.Event as any) {
|
||||||
|
const deleteEvent = await prisma.event.delete({
|
||||||
|
where: {
|
||||||
|
id: event.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE EVENT", deleteEvent]);
|
||||||
|
}
|
||||||
|
// EVENT DELETE END
|
||||||
|
|
||||||
|
// COLLABORATION START
|
||||||
|
|
||||||
|
for (let project of checkUser?.ProjectCollaboration_Partisipasi as any) {
|
||||||
|
const deleteProject =
|
||||||
|
await prisma.projectCollaboration_Partisipasi.delete({
|
||||||
|
where: {
|
||||||
|
id: project.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE PROJECT PARTISIPASI", deleteProject]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let project of checkUser?.ProjectCollaboration_RoomChat as any) {
|
||||||
|
const deleteProject = await prisma.projectCollaboration_RoomChat.delete({
|
||||||
|
where: {
|
||||||
|
id: project.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE PROJECT ROOMCHAT", deleteProject]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let project of checkUser?.ProjectCollaboration_AnggotaRoomChat as any) {
|
||||||
|
const deleteProject =
|
||||||
|
await prisma.projectCollaboration_AnggotaRoomChat.delete({
|
||||||
|
where: {
|
||||||
|
id: project.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE PROJECT ANGGOTA ROOMCHAT", deleteProject]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let project of checkUser?.ProjectCollaboration_Message as any) {
|
||||||
|
const deleteProject = await prisma.projectCollaboration_Message.delete({
|
||||||
|
where: {
|
||||||
|
id: project.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE PROJECT MESSAGE", deleteProject]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let project of checkUser?.ProjectCollaboration as any) {
|
||||||
|
const deleteProject = await prisma.projectCollaboration.delete({
|
||||||
|
where: {
|
||||||
|
id: project.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE PROJECT", deleteProject]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// COLLABORATION END
|
||||||
|
|
||||||
|
// VOTING START
|
||||||
|
for (let voting of checkUser?.Voting_Kontributor as any) {
|
||||||
|
const deleteVotingKontributor = await prisma.voting_Kontributor.delete({
|
||||||
|
where: {
|
||||||
|
id: voting.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE VOTING KONTRIBUTOR", deleteVotingKontributor]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let voting of checkUser?.Voting as any) {
|
||||||
|
for (let id of voting?.Voting_DaftarNamaVote as any) {
|
||||||
|
const deleteVotingListName = await prisma.voting_DaftarNamaVote.delete({
|
||||||
|
where: {
|
||||||
|
id: id.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE VOTING LIST NAME", deleteVotingListName]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteVoting = await prisma.voting.delete({
|
||||||
|
where: {
|
||||||
|
id: voting.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE VOTING", deleteVoting]);
|
||||||
|
}
|
||||||
|
// VOTING END
|
||||||
|
|
||||||
|
// JOB START
|
||||||
|
for (let job of checkUser?.Job as any) {
|
||||||
|
if (job.imageId) {
|
||||||
|
const deleteJobImage = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${job.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteJobImage.ok) {
|
||||||
|
console.log("Success delete job image");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteJob = await prisma.job.delete({
|
||||||
|
where: {
|
||||||
|
id: job.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE JOB", deleteJob]);
|
||||||
|
}
|
||||||
|
// JOB END
|
||||||
|
|
||||||
|
// FORUM START
|
||||||
|
|
||||||
|
for (let forum of checkUser?.Forum_ReportKomentar as any) {
|
||||||
|
const deleteForum = await prisma.forum_ReportKomentar.delete({
|
||||||
|
where: {
|
||||||
|
id: forum.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE FORUM REPORT KOMENTAR", deleteForum]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let forum of checkUser?.Forum_ReportPosting as any) {
|
||||||
|
const deleteForum = await prisma.forum_ReportPosting.delete({
|
||||||
|
where: {
|
||||||
|
id: forum.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE FORUM REPORT POSTING", deleteForum]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let forum of checkUser?.Forum_Komentar as any) {
|
||||||
|
const deleteForum = await prisma.forum_Komentar.delete({
|
||||||
|
where: {
|
||||||
|
id: forum.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE FORUM KOMENTAR", deleteForum]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let forum of checkUser?.Forum_Posting as any) {
|
||||||
|
const deleteForum = await prisma.forum_Posting.delete({
|
||||||
|
where: {
|
||||||
|
id: forum.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE FORUM POSTING", deleteForum]);
|
||||||
|
}
|
||||||
|
// FORUM END
|
||||||
|
|
||||||
|
// INVESTASI START
|
||||||
|
|
||||||
|
for (let invoice of checkUser?.Investasi_Invoice as any) {
|
||||||
|
if (invoice?.imageId) {
|
||||||
|
const deleteInvoiceImage = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${invoice.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteInvoiceImage.ok) {
|
||||||
|
console.log("Success delete invoice image");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteInvoice = await prisma.investasi_Invoice.delete({
|
||||||
|
where: {
|
||||||
|
id: invoice.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE INVOICE INVESTASI", deleteInvoice]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let investasi of checkUser?.Investasi as any) {
|
||||||
|
for (let berita of investasi?.BeritaInvestasi as any) {
|
||||||
|
if (berita?.imageId) {
|
||||||
|
const deleteBeritaImage = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${berita.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteBeritaImage.ok) {
|
||||||
|
console.log("Success delete image berita investasi");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const deleteBerita = await prisma.beritaInvestasi.delete({
|
||||||
|
where: {
|
||||||
|
id: berita.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE BERITA INVESTASI", deleteBerita]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let dokumen of investasi?.DokumenInvestasi as any) {
|
||||||
|
if (dokumen?.fileId) {
|
||||||
|
const deleteDokumenImage = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${dokumen.fileId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteDokumenImage.ok) {
|
||||||
|
console.log("Success delete image dokumen investasi");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const deleteDokumen = await prisma.dokumenInvestasi.delete({
|
||||||
|
where: {
|
||||||
|
id: dokumen.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE DOKUMEN INVESTASI", deleteDokumen]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (investasi?.prospektusFileId) {
|
||||||
|
const deleteProspektusFile = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${investasi.prospektusFileId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteProspektusFile.ok) {
|
||||||
|
console.log("Success delete prospektus file investasi");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (investasi?.imageId) {
|
||||||
|
const deleteInvestasiImage = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${investasi.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteInvestasiImage.ok) {
|
||||||
|
console.log("Success delete image investasi");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteInvestasi = await prisma.investasi.delete({
|
||||||
|
where: {
|
||||||
|
id: investasi.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE INVESTASI", deleteInvestasi]);
|
||||||
|
}
|
||||||
|
// INVESTASI END
|
||||||
|
|
||||||
|
// DONASI START
|
||||||
|
|
||||||
|
for (let donasiInvoice of checkUser?.Donasi_Invoice as any) {
|
||||||
|
if (donasiInvoice?.imageId) {
|
||||||
|
const deleteInvoiceImage = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${donasiInvoice.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteInvoiceImage.ok) {
|
||||||
|
console.log("Success delete invoice image");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const deleteInvoice = await prisma.donasi_Invoice.delete({
|
||||||
|
where: {
|
||||||
|
id: donasiInvoice.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE INVOICE DONASI", deleteInvoice]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let donasi of checkUser?.Donasi as any) {
|
||||||
|
for (let kabar of donasi?.Donasi_Kabar as any) {
|
||||||
|
if (kabar?.imageId) {
|
||||||
|
const deleteKabarImage = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${kabar.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteKabarImage.ok) {
|
||||||
|
console.log("Success delete kabar image");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const deleteKabar = await prisma.donasi_Kabar.delete({
|
||||||
|
where: {
|
||||||
|
id: kabar.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE KABAR DONASI", deleteKabar]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let pencairanDana of donasi?.Donasi_PencairanDana as any) {
|
||||||
|
if (pencairanDana?.imageId) {
|
||||||
|
const deletePencairanDanaImage = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${pencairanDana.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deletePencairanDanaImage.ok) {
|
||||||
|
console.log("Success delete pencairan dana image");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const deletePencairanDana = await prisma.donasi_PencairanDana.delete({
|
||||||
|
where: {
|
||||||
|
id: pencairanDana.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE PENCAIRAN DANA DONASI", deletePencairanDana]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteImageCerita = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${donasi?.CeritaDonasi?.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteImageCerita.ok) {
|
||||||
|
console.log("Success delete image cerita donasi");
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteCerita = await prisma.donasi_Cerita.delete({
|
||||||
|
where: {
|
||||||
|
donasiId: donasi.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE CERITA DONASI", deleteCerita]);
|
||||||
|
|
||||||
|
const deleteImageDonasi = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${donasi?.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteImageDonasi.ok) {
|
||||||
|
console.log("Success delete image donasi");
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteDonasi = await prisma.donasi.delete({
|
||||||
|
where: {
|
||||||
|
id: donasi.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE DONASI", deleteDonasi]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// DONASI END
|
||||||
|
|
||||||
|
// PORTOFOLIO DELETE START
|
||||||
|
for (const portofolio of checkUser?.Profile?.Portofolio as any) {
|
||||||
|
if (portofolio?.BusinessMaps?.id) {
|
||||||
|
const deleteLogo = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${portofolio?.BusinessMaps?.imageId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteLogo.ok) {
|
||||||
|
console.log("Success delete logo");
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteMaps = await prisma.businessMaps.delete({
|
||||||
|
where: {
|
||||||
|
id: portofolio?.BusinessMaps?.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE MAPS", deleteMaps]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (portofolio?.Portofolio_MediaSosial?.id) {
|
||||||
|
const deleteSosialMedia = await prisma.portofolio_MediaSosial.delete({
|
||||||
|
where: {
|
||||||
|
portofolioId: portofolio.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE SOSIAL MEDIA", deleteSosialMedia]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (portofolio?.logoId) {
|
||||||
|
const deleteLogo = await fetch(
|
||||||
|
`https://wibu-storage.wibudev.com/api/files/${portofolio?.logoId}/delete`,
|
||||||
|
{
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${process.env.WS_APIKEY}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (deleteLogo.ok) {
|
||||||
|
console.log("Success delete logo");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const deletePortofolio = await prisma.portofolio.delete({
|
||||||
|
where: {
|
||||||
|
id: portofolio.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(["DELETE PORTOFOLIO", deletePortofolio]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteProfile = await prisma.profile.delete({
|
||||||
|
where: {
|
||||||
|
userId: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE PROFILE", deleteProfile]);
|
||||||
|
// PORTOFOLIO DELETE END
|
||||||
|
|
||||||
|
const deleteUser = await prisma.user.delete({
|
||||||
|
where: {
|
||||||
|
id: id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
console.log(["DELETE USER", deleteUser]);
|
||||||
|
|
||||||
|
console.log("[END DELETE ALL >>>]");
|
||||||
|
|
||||||
|
return NextResponse.json(
|
||||||
|
{ success: true, message: "Berhasil menghapus data" },
|
||||||
|
{ status: 200 }
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(["ERROR DELETE ALL", error]);
|
||||||
|
return NextResponse.json(
|
||||||
|
{
|
||||||
|
success: false,
|
||||||
|
message: "Error delete data from API ",
|
||||||
|
reason: (error as Error).message,
|
||||||
|
},
|
||||||
|
{ status: 500 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -60,12 +60,14 @@ async function seederUser() {
|
|||||||
username: i.name,
|
username: i.name,
|
||||||
masterUserRoleId: i.masterUserRoleId,
|
masterUserRoleId: i.masterUserRoleId,
|
||||||
active: i.active,
|
active: i.active,
|
||||||
|
termsOfServiceAccepted: i.termsOfServiceAccepted,
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
nomor: i.nomor,
|
nomor: i.nomor,
|
||||||
username: i.name,
|
username: i.name,
|
||||||
masterUserRoleId: i.masterUserRoleId,
|
masterUserRoleId: i.masterUserRoleId,
|
||||||
active: i.active,
|
active: i.active,
|
||||||
|
termsOfServiceAccepted: i.termsOfServiceAccepted,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -564,10 +566,12 @@ async function masterKategoriApp() {
|
|||||||
create: {
|
create: {
|
||||||
id: a.id,
|
id: a.id,
|
||||||
name: a.name,
|
name: a.name,
|
||||||
|
value: a.value,
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
id: a.id,
|
id: a.id,
|
||||||
name: a.name,
|
name: a.name,
|
||||||
|
value: a.value,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,37 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"name": "Event"
|
"name": "Event",
|
||||||
|
"value": "event"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "2",
|
"id": "2",
|
||||||
"name": "Job"
|
"name": "Job",
|
||||||
|
"value": "job"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "3",
|
"id": "3",
|
||||||
"name": "Voting"
|
"name": "Voting",
|
||||||
|
"value": "voting"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "4",
|
"id": "4",
|
||||||
"name": "Donasi"
|
"name": "Donasi",
|
||||||
|
"value": "donasi"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "5",
|
"id": "5",
|
||||||
"name": "Investasi"
|
"name": "Investasi",
|
||||||
|
"value": "investasi"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "6",
|
"id": "6",
|
||||||
"name": "Forum"
|
"name": "Forum",
|
||||||
|
"value": "forum"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "7",
|
"id": "7",
|
||||||
"name": "Collaboration"
|
"name": "Collaboration",
|
||||||
|
"value": "collaboration"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,14 +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": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fahmi_admin",
|
"name": "fahmi_admin",
|
||||||
"nomor": "628123833845",
|
"nomor": "628123833845",
|
||||||
"masterUserRoleId": "2",
|
"masterUserRoleId": "2",
|
||||||
"active": true
|
"active": true,
|
||||||
|
"termsOfServiceAccepted": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const CONFIG: MiddlewareConfig = {
|
|||||||
publicRoutes: [
|
publicRoutes: [
|
||||||
"/",
|
"/",
|
||||||
"/.well-known/*",
|
"/.well-known/*",
|
||||||
|
"/terms-of-service.html",
|
||||||
"/privacy-policy.html",
|
"/privacy-policy.html",
|
||||||
"/api/helper/*",
|
"/api/helper/*",
|
||||||
"/api/not-user/*",
|
"/api/not-user/*",
|
||||||
|
|||||||
Reference in New Issue
Block a user