Tambahan Di menu PPID
This commit is contained in:
5
prisma/data/list-caraMemperolehInformasi.json
Normal file
5
prisma/data/list-caraMemperolehInformasi.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[
|
||||||
|
{"name": "Melihat/Membaca/Mendengarkan/Mencatat"},
|
||||||
|
{"name": "Mendapatkan Salinan Informasi (Hardcopy)"},
|
||||||
|
{"name": "Mendapatkan Salinan Informasi (Softcopy)"}
|
||||||
|
]
|
||||||
5
prisma/data/list-caraMemperolehSalinanInformasi.json
Normal file
5
prisma/data/list-caraMemperolehSalinanInformasi.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[
|
||||||
|
{ "name": "Mengambil Langsung" },
|
||||||
|
{ "name": "Dikirim Via Post" },
|
||||||
|
{ "name": "Dikirim Via Email" }
|
||||||
|
]
|
||||||
6
prisma/data/list-jenisInfromasi.json
Normal file
6
prisma/data/list-jenisInfromasi.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[
|
||||||
|
{ "name": "Keuangan Desa" },
|
||||||
|
{ "name": "Pembangunan Desa" },
|
||||||
|
{ "name": "Data Demografi" },
|
||||||
|
{ "name": "Lainnya" }
|
||||||
|
]
|
||||||
7
prisma/data/ppid/profile-ppid/profilePPid.json
Normal file
7
prisma/data/ppid/profile-ppid/profilePPid.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[
|
||||||
|
{"name": "<p>I.B Surya Prabhawa Manuaba, S.H., M.H.</p>"},
|
||||||
|
{"biodata" : "<h2>Biodata</h2> <p>I.B Surya Prabhawa Manuaba, S.H., M.H., adalah Perbekel Darmasaba periode 2021-2027, seorang advokat, pendiri Mantra Legal Consultants & Advocates, serta aktif di bidang musik dan akademis. Dia menempuh pendidikan hukum di Universitas Udayana dan Universitas Mahasaraswati Denpasar, serta memiliki pengalaman luas di berbagai organisasi dan kepemimpinan.</p>"},
|
||||||
|
{"riwayat" : "<h2>Riwayat Karir</h2> <ul> <li>2021 - 2027: Perbekel Desa Darmasaba</li> <li>2015 - Sekarang: Founder & Managing Director Mantra Legal Consultants & Advocates</li> <li>2020 - Sekarang: Founder Ugawa Record Music Studio</li> <li>2010 - 2016: Dosen Fakultas Hukum Universitas Mahasaraswati Denpasar</li> </ul>"},
|
||||||
|
{"pengalaman" : "<h2>Pengalaman Organisasi</h2> <ul> <li>1996 – 1997: Ketua OSIS SMP Negeri 1 Abiansemal</li><li>1999 – 2000: Ketua OSIS SMA Negeri 1 Mengwi</li> <li>2008 – 2009: Ketua BEM Universitas Mahasaraswati Denpasar</li> <li>2008 – 2010: Ketua Sekaa Taruna Sila Dharma, Banjar Tengah, Desa Adat Tegal, Darmasaba</li> <li>2020 – Sekarang: Pengurus Young Lawyer Committee Peradi Denpasar</li> <li>2021 – Sekarang: Dewan Kehormatan Himpunan Pengusaha Muda Indonesia (HIPMI) Badung</li> <li>2023 – 2028: Komite Tetap Advokasi – Bidang Hukum dan Regulasi Kamar Dagang dan Industri Badung</li> </ul>"},
|
||||||
|
{"unggulan" : "<h2>Program Kerja Unggulan</h2> <h3>Pemberdayaan Ekonomi dan UMKM</h3> <ul> <li>Pelatihan dan pendampingan UMKM lokal</li> <li>Program bantuan modal usaha bagi pelaku usaha kecil</li><li>Digitalisasi UMKM untuk meningkatkan pemasaran produk lokal</li></ul><h3>Peningkatan Infrastruktur Desa</h3><ul><li>Pembangunan dan perbaikan jalan desa</li><li>Penyediaan fasilitas umum dan ruang terbuka hijau</li><li>Optimalisasi layanan publik berbasis digital</li></ul>"}
|
||||||
|
]
|
||||||
@@ -48,6 +48,39 @@ model AppMenuChild {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//========================================= MENU PPID ========================================= //
|
//========================================= MENU PPID ========================================= //
|
||||||
|
// ========================================= VISI MISI PPID ========================================= //
|
||||||
|
model VisiPPID {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
content String
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
deletedAt DateTime @default(now())
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
model MisiPPID {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
content String
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
deletedAt DateTime @default(now())
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================================= PROFILE PPID ========================================= //
|
||||||
|
model ProfilePPID {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String @unique
|
||||||
|
biodata String
|
||||||
|
riwayat String
|
||||||
|
pengalaman String
|
||||||
|
unggulan String
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
deletedAt DateTime @default(now())
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
}
|
||||||
|
|
||||||
// ========================================= DAFTAR INFORMASI PUBLIK ========================================= //
|
// ========================================= DAFTAR INFORMASI PUBLIK ========================================= //
|
||||||
model DaftarInformasiPublik {
|
model DaftarInformasiPublik {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
@@ -61,7 +94,70 @@ model DaftarInformasiPublik {
|
|||||||
isActive Boolean @default(true)
|
isActive Boolean @default(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//========================================= MENU PPID ========================================= //
|
//=========================================PERMOHONAN INFORMASI PUBLIK========================= //
|
||||||
|
model PermohonanInformasiPublik {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
nomor Int @default(autoincrement())
|
||||||
|
name String
|
||||||
|
nik String
|
||||||
|
notelp String
|
||||||
|
alamat String
|
||||||
|
email String
|
||||||
|
jenisInformasiDiminta JenisInformasiDiminta? @relation(fields: [jenisInformasiDimintaId], references: [id])
|
||||||
|
jenisInformasiDimintaId String?
|
||||||
|
caraMemperolehInformasi CaraMemperolehInformasi? @relation(fields: [caraMemperolehInformasiId], references: [id])
|
||||||
|
caraMemperolehInformasiId String?
|
||||||
|
caraMemperolehSalinanInformasi CaraMemperolehSalinanInformasi? @relation(fields: [caraMemperolehSalinanInformasiId], references: [id])
|
||||||
|
caraMemperolehSalinanInformasiId String?
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
deletedAt DateTime @default(now())
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
model JenisInformasiDiminta {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String @unique
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
deletedAt DateTime @default(now())
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
PermohonanInformasiPublik PermohonanInformasiPublik[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model CaraMemperolehInformasi {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String @unique
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
deletedAt DateTime @default(now())
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
PermohonanInformasiPublik PermohonanInformasiPublik[]
|
||||||
|
}
|
||||||
|
|
||||||
|
model CaraMemperolehSalinanInformasi {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String @unique
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
deletedAt DateTime @default(now())
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
PermohonanInformasiPublik PermohonanInformasiPublik[]
|
||||||
|
}
|
||||||
|
|
||||||
|
//=========================================PERMOHONAN INFORMASI KEBERATAN PUBLIK========================= //
|
||||||
|
model FormulirPermohonanKeberatan {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String
|
||||||
|
email String
|
||||||
|
notelp String
|
||||||
|
alasan String
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
deletedAt DateTime @default(now())
|
||||||
|
isActive Boolean @default(true)
|
||||||
|
}
|
||||||
|
|
||||||
// ========================================= IKM ========================================= //
|
// ========================================= IKM ========================================= //
|
||||||
model IndeksKepuasanMasyarakat {
|
model IndeksKepuasanMasyarakat {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
|
import prisma from '@/lib/prisma'
|
||||||
|
import categoryPengumuman from './data/category-pengumuman.json'
|
||||||
|
import katagoryBerita from './data/katagory-berita.json'
|
||||||
|
import caraMemperolehInformasi from './data/list-caraMemperolehInformasi.json'
|
||||||
|
import caraMemperolehSalinanInformasi from './data/list-caraMemperolehSalinanInformasi.json'
|
||||||
|
import jenisInformasiDiminta from './data/list-jenisInfromasi.json'
|
||||||
import layanan from './data/list-layanan.json'
|
import layanan from './data/list-layanan.json'
|
||||||
import potensi from './data/list-potensi.json'
|
import potensi from './data/list-potensi.json'
|
||||||
import katagoryBerita from './data/katagory-berita.json'
|
|
||||||
import categoryPengumuman from './data/category-pengumuman.json'
|
|
||||||
import prisma from '@/lib/prisma';
|
|
||||||
(async () => {
|
(async () => {
|
||||||
for (const l of layanan) {
|
for (const l of layanan) {
|
||||||
await prisma.layanan.upsert({
|
await prisma.layanan.upsert({
|
||||||
@@ -67,6 +70,54 @@ import prisma from '@/lib/prisma';
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log("category pengumuman success ...")
|
console.log("category pengumuman success ...")
|
||||||
|
|
||||||
|
for (const j of jenisInformasiDiminta) {
|
||||||
|
await prisma.jenisInformasiDiminta.upsert({
|
||||||
|
where: {
|
||||||
|
name: j.name
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: j.name
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: j.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log("jenis informasi diminta success ...")
|
||||||
|
|
||||||
|
for (const c of caraMemperolehInformasi) {
|
||||||
|
await prisma.caraMemperolehInformasi.upsert({
|
||||||
|
where: {
|
||||||
|
name: c.name
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: c.name
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: c.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log("cara memperoleh informasi success ...")
|
||||||
|
|
||||||
|
for (const c of caraMemperolehSalinanInformasi) {
|
||||||
|
await prisma.caraMemperolehSalinanInformasi.upsert({
|
||||||
|
where: {
|
||||||
|
name: c.name
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
name: c.name
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
name: c.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log("cara memperoleh salinan informasi success ...")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})().then(() => prisma.$disconnect()).catch((e) => {
|
})().then(() => prisma.$disconnect()).catch((e) => {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
prisma.$disconnect()
|
prisma.$disconnect()
|
||||||
|
|||||||
@@ -87,4 +87,4 @@ const stateDashboardBerita = proxy({
|
|||||||
berita,
|
berita,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default stateDashboardBerita;
|
export default stateDashboardBerita;
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
import ApiFetch from "@/lib/api-fetch";
|
||||||
|
import { Prisma } from "@prisma/client";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import { proxy } from "valtio";
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
const templateForm = z.object({
|
||||||
|
name: z.string().min(3, "Nama minimal 3 karakter"),
|
||||||
|
nik: z.string().min(3, "NIK minimal 3 karakter"),
|
||||||
|
notelp: z.string().min(3, "Nomor Telepon minimal 3 karakter"),
|
||||||
|
alamat: z.string().min(3, "Alamat minimal 3 karakter"),
|
||||||
|
email: z.string().min(3, "Email minimal 3 karakter"),
|
||||||
|
jenisInformasiDimintaId: z.string().nonempty(),
|
||||||
|
caraMemperolehInformasiId: z.string().nonempty(),
|
||||||
|
caraMemperolehSalinanInformasiId: z.string().nonempty(),
|
||||||
|
})
|
||||||
|
|
||||||
|
const jenisInformasiDiminta = proxy({
|
||||||
|
findMany: {
|
||||||
|
data: null as
|
||||||
|
| null
|
||||||
|
| Prisma.JenisInformasiDimintaGetPayload<{ omit: { isActive: true } }>[],
|
||||||
|
async load(){
|
||||||
|
const res = await ApiFetch.api.ppid.permohonaninformasipublik.jenisInformasi["find-many"].get();
|
||||||
|
if (res.status === 200) {
|
||||||
|
jenisInformasiDiminta.findMany.data = res.data?.data ?? [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const caraMemperolehInformasi = proxy({
|
||||||
|
findMany: {
|
||||||
|
data: null as
|
||||||
|
| null
|
||||||
|
| Prisma.CaraMemperolehInformasiGetPayload<{ omit: { isActive: true } }>[],
|
||||||
|
async load() {
|
||||||
|
const res = await ApiFetch.api.ppid.permohonaninformasipublik.memperolehInformasi["find-many"].get();
|
||||||
|
if (res.status === 200) {
|
||||||
|
caraMemperolehInformasi.findMany.data = res.data?.data ?? [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const caraMemperolehSalinanInformasi = proxy({
|
||||||
|
findMany: {
|
||||||
|
data: null as
|
||||||
|
| null
|
||||||
|
| Prisma.CaraMemperolehSalinanInformasiGetPayload<{ omit: { isActive: true } }>[],
|
||||||
|
async load() {
|
||||||
|
const res = await ApiFetch.api.ppid.permohonaninformasipublik.salinanInformasi["find-many"].get();
|
||||||
|
if (res.status === 200) {
|
||||||
|
caraMemperolehSalinanInformasi.findMany.data = res.data?.data ?? [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
type PermohonanInformasiPublikForm = Prisma.PermohonanInformasiPublikGetPayload<{
|
||||||
|
select: {
|
||||||
|
name: true;
|
||||||
|
nik: true;
|
||||||
|
notelp: true;
|
||||||
|
alamat: true;
|
||||||
|
email: true;
|
||||||
|
jenisInformasiDimintaId: true;
|
||||||
|
caraMemperolehInformasiId: true;
|
||||||
|
caraMemperolehSalinanInformasiId: true;
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
|
||||||
|
const permohonanInformasiPublikForm = proxy({
|
||||||
|
create: {
|
||||||
|
form: {} as PermohonanInformasiPublikForm,
|
||||||
|
loading: false,
|
||||||
|
async create(){
|
||||||
|
const cek = templateForm.safeParse(permohonanInformasiPublikForm.create.form);
|
||||||
|
if(!cek.success) {
|
||||||
|
const err = `[${cek.error.issues
|
||||||
|
.map((v) => `${v.path.join(".")}`)
|
||||||
|
.join("\n")}] required`;
|
||||||
|
return toast.error(err);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
permohonanInformasiPublikForm.create.loading = true;
|
||||||
|
const res = await ApiFetch.api.ppid.permohonaninformasipublik["create"].post(permohonanInformasiPublikForm.create.form);
|
||||||
|
if (res.status === 200) {
|
||||||
|
permohonanInformasiPublikForm.findMany.load();
|
||||||
|
return toast.success("success create");
|
||||||
|
}
|
||||||
|
return toast.error("failed create");
|
||||||
|
} catch (error) {
|
||||||
|
console.log((error as Error).message);
|
||||||
|
} finally {
|
||||||
|
permohonanInformasiPublikForm.create.loading = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
findMany: {
|
||||||
|
data: null as
|
||||||
|
| Prisma.PermohonanInformasiPublikGetPayload<{ omit: { isActive: true } }>[]
|
||||||
|
| null,
|
||||||
|
async load() {
|
||||||
|
const res = await ApiFetch.api.ppid.permohonaninformasipublik["find-many"].get();
|
||||||
|
if (res.status === 200) {
|
||||||
|
permohonanInformasiPublikForm.findMany.data = res.data?.data ?? [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const statePermohonanInformasi = proxy({
|
||||||
|
permohonanInformasiPublikForm,
|
||||||
|
jenisInformasiDiminta,
|
||||||
|
caraMemperolehInformasi,
|
||||||
|
caraMemperolehSalinanInformasi
|
||||||
|
})
|
||||||
|
|
||||||
|
export default statePermohonanInformasi;
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
import ApiFetch from "@/lib/api-fetch";
|
||||||
|
import { Prisma } from "@prisma/client";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import { proxy } from "valtio";
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
const templateForm = z.object({
|
||||||
|
name: z.string().min(3, "Nama minimal 3 karakter"),
|
||||||
|
email: z.string().min(3, "Email minimal 3 karakter"),
|
||||||
|
notelp: z.string().min(3, "Nomor Telepon minimal 3 karakter"),
|
||||||
|
alasan: z.string().min(3, "Alasan minimal 3 karakter"),
|
||||||
|
})
|
||||||
|
|
||||||
|
type PermohonanKeberatanInformasiForm = Prisma.FormulirPermohonanKeberatanGetPayload<{
|
||||||
|
select: {
|
||||||
|
name: true;
|
||||||
|
email: true;
|
||||||
|
notelp: true;
|
||||||
|
alasan: true;
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
|
||||||
|
const permohonanKeberatanInformasiForm = proxy({
|
||||||
|
create: {
|
||||||
|
form: {} as PermohonanKeberatanInformasiForm,
|
||||||
|
loading: false,
|
||||||
|
async create(){
|
||||||
|
const cek = templateForm.safeParse(permohonanKeberatanInformasiForm.create.form);
|
||||||
|
if(!cek.success) {
|
||||||
|
const err = `[${cek.error.issues
|
||||||
|
.map((v) => `${v.path.join(".")}`)
|
||||||
|
.join("\n")}] required`;
|
||||||
|
return toast.error(err);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
permohonanKeberatanInformasiForm.create.loading = true;
|
||||||
|
const res = await ApiFetch.api.ppid.permohonankeberataninformasipublik["create"].post(permohonanKeberatanInformasiForm.create.form);
|
||||||
|
if (res.status === 200) {
|
||||||
|
permohonanKeberatanInformasiForm.findMany.load();
|
||||||
|
return toast.success("success create");
|
||||||
|
}
|
||||||
|
return toast.error("failed create");
|
||||||
|
} catch (error) {
|
||||||
|
console.log((error as Error).message);
|
||||||
|
} finally {
|
||||||
|
permohonanKeberatanInformasiForm.create.loading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
findMany: {
|
||||||
|
data: null as
|
||||||
|
| Prisma.FormulirPermohonanKeberatanGetPayload<{omit: {isActive: true}}>[]
|
||||||
|
| null,
|
||||||
|
async load() {
|
||||||
|
const res = await ApiFetch.api.ppid.permohonankeberataninformasipublik["find-many"].get();
|
||||||
|
if (res.status === 200) {
|
||||||
|
permohonanKeberatanInformasiForm.findMany.data = res.data?.data ?? [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const statePermohonanKeberatan = proxy({
|
||||||
|
permohonanKeberatanInformasiForm,
|
||||||
|
})
|
||||||
|
|
||||||
|
export default statePermohonanKeberatan;
|
||||||
|
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
import ApiFetch from "@/lib/api-fetch";
|
||||||
|
import { Prisma } from "@prisma/client";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import { proxy } from "valtio";
|
||||||
|
import { z } from "zod";
|
||||||
|
|
||||||
|
const templateForm = z.object({
|
||||||
|
name: z.string().min(3, "Nama minimal 3 karakter"),
|
||||||
|
biodata: z.string().min(3, "Biodata minimal 3 karakter"),
|
||||||
|
riwayat: z.string().min(3, "Riwayat minimal 3 karakter"),
|
||||||
|
pengalaman: z.string().min(3, "Pengalaman minimal 3 karakter"),
|
||||||
|
unggulan: z.string().min(3, "Unggulan minimal 3 karakter"),
|
||||||
|
})
|
||||||
|
|
||||||
|
type ProfilePPIDForm = Prisma.ProfilePPIDGetPayload<{
|
||||||
|
select: {
|
||||||
|
name: true;
|
||||||
|
biodata: true;
|
||||||
|
riwayat: true;
|
||||||
|
pengalaman: true;
|
||||||
|
unggulan: true;
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
|
||||||
|
const profilePPID = proxy({
|
||||||
|
create: {
|
||||||
|
form: {} as ProfilePPIDForm,
|
||||||
|
loading: false,
|
||||||
|
async create() {
|
||||||
|
const cek = templateForm.safeParse(profilePPID.create.form);
|
||||||
|
if (!cek.success) {
|
||||||
|
const err = `[${cek.error.issues
|
||||||
|
.map((v) => `${v.path.join(".")}`)
|
||||||
|
.join("\n")}] required`;
|
||||||
|
return toast.error(err);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
profilePPID.create.loading = true;
|
||||||
|
const res = await ApiFetch.api.ppid.profileppid["create"].post(profilePPID.create.form);
|
||||||
|
if (res.status === 200) {
|
||||||
|
profilePPID.findMany.load();
|
||||||
|
return toast.success("success create");
|
||||||
|
}
|
||||||
|
return toast.error("failed create");
|
||||||
|
} catch (error) {
|
||||||
|
console.log((error as Error).message);
|
||||||
|
} finally {
|
||||||
|
profilePPID.create.loading = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
findMany: {
|
||||||
|
data: null as
|
||||||
|
| Prisma.ProfilePPIDGetPayload<{omit: {isActive: true}}>[]
|
||||||
|
| null,
|
||||||
|
async load() {
|
||||||
|
const res = await ApiFetch.api.ppid.profileppid["find-many"].get();
|
||||||
|
if (res.status === 200) {
|
||||||
|
profilePPID.findMany.data = res.data?.data ?? [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const stateProfilePPID = proxy({
|
||||||
|
profilePPID
|
||||||
|
})
|
||||||
|
|
||||||
|
export default stateProfilePPID;
|
||||||
@@ -10,9 +10,9 @@ import { BeritaEditor } from './_com/BeritaEditor';
|
|||||||
function Page() {
|
function Page() {
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<SimpleGrid cols={2}>
|
<SimpleGrid cols={{base: 1, md: 2}}>
|
||||||
<BeritaList />
|
|
||||||
<BeritaCreate />
|
<BeritaCreate />
|
||||||
|
<BeritaList />
|
||||||
</SimpleGrid>
|
</SimpleGrid>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|||||||
94
src/app/admin/(dashboard)/ppid/_com/PPIDTextEditor.tsx
Normal file
94
src/app/admin/(dashboard)/ppid/_com/PPIDTextEditor.tsx
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
'use client'
|
||||||
|
import { Button, Stack } from '@mantine/core';
|
||||||
|
import { Link, RichTextEditor } from '@mantine/tiptap';
|
||||||
|
import Highlight from '@tiptap/extension-highlight';
|
||||||
|
import SubScript from '@tiptap/extension-subscript';
|
||||||
|
import Superscript from '@tiptap/extension-superscript';
|
||||||
|
import TextAlign from '@tiptap/extension-text-align';
|
||||||
|
import Underline from '@tiptap/extension-underline';
|
||||||
|
import { useEditor } from '@tiptap/react';
|
||||||
|
import StarterKit from '@tiptap/starter-kit';
|
||||||
|
|
||||||
|
const content =
|
||||||
|
'<h2 style="text-align: center;">Welcome to Mantine rich text editor</h2><p><code>RichTextEditor</code> component focuses on usability and is designed to be as simple as possible to bring a familiar editing experience to regular users. <code>RichTextEditor</code> is based on <a href="https://tiptap.dev/" rel="noopener noreferrer" target="_blank">Tiptap.dev</a> and supports all of its features:</p><ul><li>General text formatting: <strong>bold</strong>, <em>italic</em>, <u>underline</u>, <s>strike-through</s> </li><li>Headings (h1-h6)</li><li>Sub and super scripts (<sup><sup /></sup> and <sub><sub /></sub> tags)</li><li>Ordered and bullet lists</li><li>Text align </li><li>And all <a href="https://tiptap.dev/extensions" target="_blank" rel="noopener noreferrer">other extensions</a></li></ul>';
|
||||||
|
|
||||||
|
export function PPIDTextEditor({ onSubmit, onChange, showSubmit = true }: {
|
||||||
|
onSubmit?: (val: string) => void,
|
||||||
|
onChange: (val: string) => void,
|
||||||
|
showSubmit?: boolean }) {
|
||||||
|
const editor = useEditor({
|
||||||
|
extensions: [
|
||||||
|
StarterKit,
|
||||||
|
Underline,
|
||||||
|
Link,
|
||||||
|
Superscript,
|
||||||
|
SubScript,
|
||||||
|
Highlight,
|
||||||
|
TextAlign.configure({ types: ['heading', 'paragraph'] }),
|
||||||
|
],
|
||||||
|
immediatelyRender: false,
|
||||||
|
content,
|
||||||
|
onUpdate : ({editor}) => {
|
||||||
|
onChange(editor.getHTML())
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack>
|
||||||
|
<RichTextEditor editor={editor}>
|
||||||
|
<RichTextEditor.Toolbar sticky stickyOffset={60}>
|
||||||
|
<RichTextEditor.ControlsGroup>
|
||||||
|
<RichTextEditor.Bold />
|
||||||
|
<RichTextEditor.Italic />
|
||||||
|
<RichTextEditor.Underline />
|
||||||
|
<RichTextEditor.Strikethrough />
|
||||||
|
<RichTextEditor.ClearFormatting />
|
||||||
|
<RichTextEditor.Highlight />
|
||||||
|
<RichTextEditor.Code />
|
||||||
|
</RichTextEditor.ControlsGroup>
|
||||||
|
|
||||||
|
<RichTextEditor.ControlsGroup>
|
||||||
|
<RichTextEditor.H1 />
|
||||||
|
<RichTextEditor.H2 />
|
||||||
|
<RichTextEditor.H3 />
|
||||||
|
<RichTextEditor.H4 />
|
||||||
|
</RichTextEditor.ControlsGroup>
|
||||||
|
|
||||||
|
<RichTextEditor.ControlsGroup>
|
||||||
|
<RichTextEditor.Blockquote />
|
||||||
|
<RichTextEditor.Hr />
|
||||||
|
<RichTextEditor.BulletList />
|
||||||
|
<RichTextEditor.OrderedList />
|
||||||
|
<RichTextEditor.Subscript />
|
||||||
|
<RichTextEditor.Superscript />
|
||||||
|
</RichTextEditor.ControlsGroup>
|
||||||
|
|
||||||
|
<RichTextEditor.ControlsGroup>
|
||||||
|
<RichTextEditor.Link />
|
||||||
|
<RichTextEditor.Unlink />
|
||||||
|
</RichTextEditor.ControlsGroup>
|
||||||
|
|
||||||
|
<RichTextEditor.ControlsGroup>
|
||||||
|
<RichTextEditor.AlignLeft />
|
||||||
|
<RichTextEditor.AlignCenter />
|
||||||
|
<RichTextEditor.AlignJustify />
|
||||||
|
<RichTextEditor.AlignRight />
|
||||||
|
</RichTextEditor.ControlsGroup>
|
||||||
|
|
||||||
|
<RichTextEditor.ControlsGroup>
|
||||||
|
<RichTextEditor.Undo />
|
||||||
|
<RichTextEditor.Redo />
|
||||||
|
</RichTextEditor.ControlsGroup>
|
||||||
|
</RichTextEditor.Toolbar>
|
||||||
|
|
||||||
|
<RichTextEditor.Content />
|
||||||
|
</RichTextEditor>
|
||||||
|
{showSubmit && (
|
||||||
|
<Button onClick={() => {
|
||||||
|
if (!editor) return
|
||||||
|
onSubmit?.(editor?.getHTML())
|
||||||
|
}}>Submit</Button>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { Box, Button, Group, SimpleGrid, Skeleton, Stack, Table, TableTbody, TableTd, TableTh, TableThead, TableTr, TextInput, Title } from '@mantine/core';
|
import { Box, Button, Group, Paper, SimpleGrid, Skeleton, Stack, Table, TableTbody, TableTd, TableTh, TableThead, TableTr, TextInput, Title } from '@mantine/core';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useProxy } from 'valtio/utils';
|
import { useProxy } from 'valtio/utils';
|
||||||
import stateDaftarInformasiPublik from '../../_state/ppid/daftar_informasi_publik/daftarInformasiPublik';
|
import stateDaftarInformasiPublik from '../../_state/ppid/daftar_informasi_publik/daftarInformasiPublik';
|
||||||
@@ -20,35 +20,37 @@ function Page() {
|
|||||||
<Box>
|
<Box>
|
||||||
<SimpleGrid cols={{ base: 1, md: 2 }}>
|
<SimpleGrid cols={{ base: 1, md: 2 }}>
|
||||||
<Box>
|
<Box>
|
||||||
<Stack gap={"xs"}>
|
<Paper bg={colors['white-1']} p={'md'}>
|
||||||
<Title fw={"bold"} order={3}>Daftar Informasi Publik Desa Darmasaba</Title>
|
<Stack gap={"xs"}>
|
||||||
<TextInput
|
<Title fw={"bold"} order={3}>Daftar Informasi Publik Desa Darmasaba</Title>
|
||||||
label="Jenis Informasi"
|
<TextInput
|
||||||
placeholder="masukkan jenis informasi"
|
label="Jenis Informasi"
|
||||||
onChange={(val) => {
|
placeholder="masukkan jenis informasi"
|
||||||
daftarInformasi.create.form.jenisInformasi = val.target.value
|
onChange={(val) => {
|
||||||
}}
|
daftarInformasi.create.form.jenisInformasi = val.target.value
|
||||||
/>
|
}}
|
||||||
<PPIDEditor
|
/>
|
||||||
showSubmit={false}
|
<PPIDEditor
|
||||||
onChange={(val) => {
|
showSubmit={false}
|
||||||
daftarInformasi.create.form.deskripsi = val
|
onChange={(val) => {
|
||||||
}}
|
daftarInformasi.create.form.deskripsi = val
|
||||||
/>
|
}}
|
||||||
<TextInput
|
/>
|
||||||
label="Tanggal Publikasi"
|
<TextInput
|
||||||
placeholder="masukkan tanggal publikasi"
|
label="Tanggal Publikasi"
|
||||||
onChange={(val) => {
|
placeholder="masukkan tanggal publikasi"
|
||||||
daftarInformasi.create.form.tanggal = val.target.value
|
onChange={(val) => {
|
||||||
}}
|
daftarInformasi.create.form.tanggal = val.target.value
|
||||||
/>
|
}}
|
||||||
<Group>
|
/>
|
||||||
<Button
|
<Group>
|
||||||
bg={colors['blue-button']}
|
<Button
|
||||||
onClick={submit}
|
bg={colors['blue-button']}
|
||||||
>Submit</Button>
|
onClick={submit}
|
||||||
</Group>
|
>Submit</Button>
|
||||||
</Stack>
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<ListDaftarInformasi />
|
<ListDaftarInformasi />
|
||||||
@@ -64,46 +66,48 @@ function ListDaftarInformasi() {
|
|||||||
listData.findMany.load()
|
listData.findMany.load()
|
||||||
}, [])
|
}, [])
|
||||||
if (!listData.findMany.data) return <Stack>
|
if (!listData.findMany.data) return <Stack>
|
||||||
{Array.from({length: 10}).map((v, k) => <Skeleton key={k} h={40} />)}
|
{Array.from({ length: 10 }).map((v, k) => <Skeleton key={k} h={40} />)}
|
||||||
</Stack>
|
</Stack>
|
||||||
return <Stack gap={"xs"}>
|
return <Paper bg={colors['white-1']} p={'md'}>
|
||||||
<Title fw={"bold"} order={3}>List Daftar Informasi Publik Desa Darmasaba</Title>
|
<Stack gap={"xs"}>
|
||||||
<Table
|
<Title fw={"bold"} order={3}>List Daftar Informasi Publik Desa Darmasaba</Title>
|
||||||
suppressHydrationWarning
|
<Table
|
||||||
striped
|
suppressHydrationWarning
|
||||||
highlightOnHover
|
striped
|
||||||
withTableBorder
|
highlightOnHover
|
||||||
withColumnBorders
|
withTableBorder
|
||||||
bg={colors['white-1']}
|
withColumnBorders
|
||||||
>
|
bg={colors['white-1']}
|
||||||
<TableThead>
|
>
|
||||||
<TableTr>
|
<TableThead>
|
||||||
<TableTh>
|
<TableTr>
|
||||||
No
|
<TableTh>
|
||||||
</TableTh>
|
No
|
||||||
<TableTh>
|
</TableTh>
|
||||||
Jenis Informasi
|
<TableTh>
|
||||||
</TableTh>
|
Jenis Informasi
|
||||||
<TableTh>
|
</TableTh>
|
||||||
Deskripsi
|
<TableTh>
|
||||||
</TableTh>
|
Deskripsi
|
||||||
<TableTh>
|
</TableTh>
|
||||||
Tanggal Publikasi
|
<TableTh>
|
||||||
</TableTh>
|
Tanggal Publikasi
|
||||||
</TableTr>
|
</TableTh>
|
||||||
</TableThead>
|
</TableTr>
|
||||||
<TableTbody>
|
</TableThead>
|
||||||
{listData.findMany.data?.map((item) => (
|
<TableTbody>
|
||||||
<TableTr key={item.id}>
|
{listData.findMany.data?.map((item) => (
|
||||||
<TableTd>{item.nomor}</TableTd>
|
<TableTr key={item.id}>
|
||||||
<TableTd>{item.jenisInformasi}</TableTd>
|
<TableTd>{item.nomor}</TableTd>
|
||||||
<TableTd dangerouslySetInnerHTML={{ __html: item.deskripsi }}></TableTd>
|
<TableTd>{item.jenisInformasi}</TableTd>
|
||||||
<TableTd>{item.tanggal}</TableTd>
|
<TableTd dangerouslySetInnerHTML={{ __html: item.deskripsi }}></TableTd>
|
||||||
</TableTr>
|
<TableTd>{item.tanggal}</TableTd>
|
||||||
))}
|
</TableTr>
|
||||||
</TableTbody>
|
))}
|
||||||
</Table>
|
</TableTbody>
|
||||||
</Stack>
|
</Table>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import stateGrafikBerdasarkanJenisKelamin from '@/app/admin/(dashboard)/_state/ppid/indeks_kepuasan_masyarakat/grafikBerdasarkanJenisKelamin';
|
import stateGrafikBerdasarkanJenisKelamin from '@/app/admin/(dashboard)/_state/ppid/indeks_kepuasan_masyarakat/grafikBerdasarkanJenisKelamin';
|
||||||
import colors from '@/con/colors';
|
import colors from '@/con/colors';
|
||||||
import { Box, Button, Center, Flex, Stack, Text, TextInput, Title } from '@mantine/core';
|
import { Box, Button, Center, Flex, Paper, Stack, Text, TextInput, Title } from '@mantine/core';
|
||||||
import { useShallowEffect } from '@mantine/hooks';
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Cell, Pie, PieChart } from 'recharts';
|
import { Cell, Pie, PieChart } from 'recharts';
|
||||||
@@ -21,7 +21,7 @@ function GrafikBerdasarkanJenisKelamin() {
|
|||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
const totalLaki = data.reduce((acc: number, cur: any) => acc + Number(cur.laki || 0), 0);
|
const totalLaki = data.reduce((acc: number, cur: any) => acc + Number(cur.laki || 0), 0);
|
||||||
const totalPerempuan = data.reduce((acc: number, cur: any) => acc + Number(cur.perempuan || 0), 0);
|
const totalPerempuan = data.reduce((acc: number, cur: any) => acc + Number(cur.perempuan || 0), 0);
|
||||||
|
|
||||||
setDonutData([
|
setDonutData([
|
||||||
{ name: 'Laki-laki', value: totalLaki, color: colors['blue-button'], key: 'laki-laki' },
|
{ name: 'Laki-laki', value: totalLaki, color: colors['blue-button'], key: 'laki-laki' },
|
||||||
{ name: 'Perempuan', value: totalPerempuan, color: '#FF6384', key: 'perempuan' }
|
{ name: 'Perempuan', value: totalPerempuan, color: '#FF6384', key: 'perempuan' }
|
||||||
@@ -44,15 +44,15 @@ function GrafikBerdasarkanJenisKelamin() {
|
|||||||
try {
|
try {
|
||||||
// Simpan data baru
|
// Simpan data baru
|
||||||
await grafikBerdasarkanJenisKelamin.create.create();
|
await grafikBerdasarkanJenisKelamin.create.create();
|
||||||
|
|
||||||
// Muat ulang data
|
// Muat ulang data
|
||||||
await grafikBerdasarkanJenisKelamin.findMany.load();
|
await grafikBerdasarkanJenisKelamin.findMany.load();
|
||||||
|
|
||||||
// Update chart dengan data baru
|
// Update chart dengan data baru
|
||||||
if (grafikBerdasarkanJenisKelamin.findMany.data) {
|
if (grafikBerdasarkanJenisKelamin.findMany.data) {
|
||||||
updateChartData(grafikBerdasarkanJenisKelamin.findMany.data);
|
updateChartData(grafikBerdasarkanJenisKelamin.findMany.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset form setelah submit
|
// Reset form setelah submit
|
||||||
grafikBerdasarkanJenisKelamin.create.form.laki = '';
|
grafikBerdasarkanJenisKelamin.create.form.laki = '';
|
||||||
grafikBerdasarkanJenisKelamin.create.form.perempuan = '';
|
grafikBerdasarkanJenisKelamin.create.form.perempuan = '';
|
||||||
@@ -64,72 +64,76 @@ function GrafikBerdasarkanJenisKelamin() {
|
|||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Box py={15}>
|
<Box py={15}>
|
||||||
<Title order={3}>Grafik Hasil Kepuasan Masyarakat Terhadap Pelayanan Publik</Title>
|
<Paper bg={colors['white-1']} w={{ base: '100%', md: '50%' }} p={'md'}>
|
||||||
<TextInput
|
<Title order={3}>Grafik Hasil Kepuasan Masyarakat Terhadap Pelayanan Publik</Title>
|
||||||
w={{ base: '100%', md: '50%' }}
|
<TextInput
|
||||||
label="Laki-laki"
|
w={{ base: '100%', md: '50%' }}
|
||||||
placeholder="masukkan jumlah laki-laki"
|
label="Laki-laki"
|
||||||
value={grafikBerdasarkanJenisKelamin.create.form.laki}
|
placeholder="masukkan jumlah laki-laki"
|
||||||
onChange={(val) => {
|
value={grafikBerdasarkanJenisKelamin.create.form.laki}
|
||||||
grafikBerdasarkanJenisKelamin.create.form.laki = val.currentTarget.value;
|
onChange={(val) => {
|
||||||
}}
|
grafikBerdasarkanJenisKelamin.create.form.laki = val.currentTarget.value;
|
||||||
/>
|
}}
|
||||||
<TextInput
|
/>
|
||||||
w={{ base: '100%', md: '50%' }}
|
<TextInput
|
||||||
label="Perempuan"
|
w={{ base: '100%', md: '50%' }}
|
||||||
type="number"
|
label="Perempuan"
|
||||||
placeholder="masukkan jumlah perempuan"
|
type="number"
|
||||||
value={grafikBerdasarkanJenisKelamin.create.form.perempuan}
|
placeholder="masukkan jumlah perempuan"
|
||||||
onChange={(val) => {
|
value={grafikBerdasarkanJenisKelamin.create.form.perempuan}
|
||||||
grafikBerdasarkanJenisKelamin.create.form.perempuan = val.currentTarget.value;
|
onChange={(val) => {
|
||||||
}}
|
grafikBerdasarkanJenisKelamin.create.form.perempuan = val.currentTarget.value;
|
||||||
/>
|
}}
|
||||||
<Button
|
/>
|
||||||
mt={10}
|
<Button
|
||||||
bg={colors['blue-button']}
|
mt={10}
|
||||||
onClick={handleSubmit}
|
bg={colors['blue-button']}
|
||||||
>
|
onClick={handleSubmit}
|
||||||
Submit
|
>
|
||||||
</Button>
|
Submit
|
||||||
|
</Button>
|
||||||
|
</Paper>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{/* Chart */}
|
{/* Chart */}
|
||||||
<Box>
|
<Box>
|
||||||
<Stack>
|
<Paper bg={colors['white-1']} w={{ base: '100%', md: '50%' }} p={'md'}>
|
||||||
<Title pb={10} order={3}>Grafik Berdasarkan Jenis Kelamin Responden</Title>
|
<Stack>
|
||||||
{mounted && donutData.length > 0 && (
|
<Title pb={10} order={3}>Grafik Berdasarkan Jenis Kelamin Responden</Title>
|
||||||
<Box style={{ width: '100%', height: 'auto', minHeight: 900 }}>
|
{mounted && donutData.length > 0 && (
|
||||||
<Center>
|
<Box style={{ width: '100%', height: 'auto', minHeight: 900 }}>
|
||||||
<PieChart
|
<Center>
|
||||||
width={1000} height={400}
|
<PieChart
|
||||||
data={donutData}
|
width={1000} height={400}
|
||||||
>
|
|
||||||
|
|
||||||
<Pie
|
|
||||||
dataKey="value"
|
|
||||||
nameKey="name"
|
|
||||||
data={donutData}
|
data={donutData}
|
||||||
innerRadius={120}
|
|
||||||
outerRadius={160}
|
|
||||||
label
|
|
||||||
>
|
>
|
||||||
{donutData.map((entry, index) => (
|
|
||||||
<Cell key={`cell-${index}`} fill={entry.color} />
|
<Pie
|
||||||
))}
|
dataKey="value"
|
||||||
</Pie>
|
nameKey="name"
|
||||||
</PieChart>
|
data={donutData}
|
||||||
</Center>
|
innerRadius={120}
|
||||||
<Flex gap={"md"} align={"center"}>
|
outerRadius={230}
|
||||||
<Box bg={'#FF6384'} w={20} h={20} />
|
label={true}
|
||||||
<Text>Perempuan: {donutData.find((entry) => entry.name === 'Perempuan')?.value}</Text>
|
>
|
||||||
</Flex>
|
{donutData.map((entry, index) => (
|
||||||
<Flex gap={"md"} align={"center"}>
|
<Cell key={`cell-${index}`} fill={entry.color} />
|
||||||
<Box bg={colors['blue-button']} w={20} h={20} />
|
))}
|
||||||
<Text>Laki-laki: {donutData.find((entry) => entry.name === 'Laki-laki')?.value}</Text>
|
</Pie>
|
||||||
</Flex>
|
</PieChart>
|
||||||
</Box>
|
</Center>
|
||||||
)}
|
<Flex gap={"md"} align={"center"}>
|
||||||
</Stack>
|
<Box bg={'#FF6384'} w={20} h={20} />
|
||||||
|
<Text>Perempuan: {donutData.find((entry) => entry.name === 'Perempuan')?.value}</Text>
|
||||||
|
</Flex>
|
||||||
|
<Flex gap={"md"} align={"center"}>
|
||||||
|
<Box bg={colors['blue-button']} w={20} h={20} />
|
||||||
|
<Text>Laki-laki: {donutData.find((entry) => entry.name === 'Laki-laki')?.value}</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import stateGrafikResponden from '@/app/admin/(dashboard)/_state/ppid/indeks_kepuasan_masyarakat/grafikBerdasarkanResponden';
|
import stateGrafikResponden from '@/app/admin/(dashboard)/_state/ppid/indeks_kepuasan_masyarakat/grafikBerdasarkanResponden';
|
||||||
import colors from '@/con/colors';
|
import colors from '@/con/colors';
|
||||||
import { Box, Button, Center, Flex, Stack, Text, TextInput, Title } from '@mantine/core';
|
import { Box, Button, Center, Flex, Group, Paper, Stack, Text, TextInput, Title } from '@mantine/core';
|
||||||
import { useShallowEffect } from '@mantine/hooks';
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { PieChart, Pie, Cell } from 'recharts';
|
import { PieChart, Pie, Cell } from 'recharts';
|
||||||
@@ -68,96 +68,103 @@ function GrafikBerdasarkanResponden() {
|
|||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Box py={15}>
|
<Box py={15}>
|
||||||
<Title order={3}>Grafik Berdasarkan Responden</Title>
|
<Paper bg={colors['white-1']} w={{ base: '100%', md: '50%' }} p={'md'}>
|
||||||
<TextInput
|
<Stack gap={"xs"}>
|
||||||
w={{ base: '100%', md: '50%' }}
|
<Title order={3}>Grafik Berdasarkan Responden</Title>
|
||||||
label="Sangat Baik"
|
<TextInput
|
||||||
value={grafikBerdasarkanResponden.create.form.sangatbaik}
|
w={{ base: '100%', md: '50%' }}
|
||||||
placeholder="masukkan jumlah respon sangat baik"
|
label="Sangat Baik"
|
||||||
onChange={(val) => {
|
value={grafikBerdasarkanResponden.create.form.sangatbaik}
|
||||||
grafikBerdasarkanResponden.create.form.sangatbaik = val.currentTarget.value;
|
placeholder="masukkan jumlah respon sangat baik"
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikBerdasarkanResponden.create.form.sangatbaik = val.currentTarget.value;
|
||||||
<TextInput
|
}}
|
||||||
w={{ base: '100%', md: '50%' }}
|
/>
|
||||||
label="Baik"
|
<TextInput
|
||||||
value={grafikBerdasarkanResponden.create.form.baik}
|
w={{ base: '100%', md: '50%' }}
|
||||||
placeholder="masukkan jumlah respon baik"
|
label="Baik"
|
||||||
onChange={(val) => {
|
value={grafikBerdasarkanResponden.create.form.baik}
|
||||||
grafikBerdasarkanResponden.create.form.baik = val.currentTarget.value;
|
placeholder="masukkan jumlah respon baik"
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikBerdasarkanResponden.create.form.baik = val.currentTarget.value;
|
||||||
<TextInput
|
}}
|
||||||
w={{ base: '100%', md: '50%' }}
|
/>
|
||||||
label="Kurang Baik"
|
<TextInput
|
||||||
value={grafikBerdasarkanResponden.create.form.kurangbaik}
|
w={{ base: '100%', md: '50%' }}
|
||||||
placeholder="masukkan jumlah respon kurang baik"
|
label="Kurang Baik"
|
||||||
onChange={(val) => {
|
value={grafikBerdasarkanResponden.create.form.kurangbaik}
|
||||||
grafikBerdasarkanResponden.create.form.kurangbaik = val.currentTarget.value;
|
placeholder="masukkan jumlah respon kurang baik"
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikBerdasarkanResponden.create.form.kurangbaik = val.currentTarget.value;
|
||||||
<TextInput
|
}}
|
||||||
w={{ base: '100%', md: '50%' }}
|
/>
|
||||||
label="Tidak Baik"
|
<TextInput
|
||||||
value={grafikBerdasarkanResponden.create.form.tidakbaik}
|
w={{ base: '100%', md: '50%' }}
|
||||||
placeholder="masukkan jumlah respon tidak baik"
|
label="Tidak Baik"
|
||||||
onChange={(val) => {
|
value={grafikBerdasarkanResponden.create.form.tidakbaik}
|
||||||
grafikBerdasarkanResponden.create.form.tidakbaik = val.currentTarget.value;
|
placeholder="masukkan jumlah respon tidak baik"
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikBerdasarkanResponden.create.form.tidakbaik = val.currentTarget.value;
|
||||||
<Button
|
}}
|
||||||
mt={10}
|
/>
|
||||||
bg={colors['blue-button']}
|
<Group>
|
||||||
onClick={handleSubmit}
|
<Button
|
||||||
>
|
bg={colors['blue-button']}
|
||||||
Submit
|
onClick={handleSubmit}
|
||||||
</Button>
|
>
|
||||||
|
Submit
|
||||||
|
</Button>
|
||||||
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{/* Chart */}
|
{/* Chart */}
|
||||||
<Box>
|
<Box>
|
||||||
<Stack>
|
<Paper bg={colors['white-1']} w={{ base: '100%', md: '50%' }} p={'md'}>
|
||||||
<Title pb={10} order={3}>Grafik Berdasarkan Responden</Title>
|
<Stack>
|
||||||
{mounted && donutData.length > 0 && (
|
<Title pb={10} order={3}>Grafik Berdasarkan Responden</Title>
|
||||||
<Box style={{ width: '100%', height: 'auto', minHeight: 900 }}>
|
{mounted && donutData.length > 0 && (
|
||||||
<Center>
|
<Box style={{ width: '100%', height: 'auto', minHeight: 900 }}>
|
||||||
<PieChart
|
<Center>
|
||||||
width={1000} height={400}
|
<PieChart
|
||||||
data={donutData}
|
width={1000} height={400}
|
||||||
>
|
|
||||||
<Pie
|
|
||||||
dataKey="value"
|
|
||||||
nameKey="name"
|
|
||||||
data={donutData}
|
data={donutData}
|
||||||
innerRadius={120}
|
|
||||||
outerRadius={160}
|
|
||||||
label
|
|
||||||
>
|
>
|
||||||
{donutData.map((entry, index) => (
|
<Pie
|
||||||
<Cell key={`cell-${index}`} fill={entry.color} />
|
dataKey="value"
|
||||||
))}
|
nameKey="name"
|
||||||
</Pie>
|
data={donutData}
|
||||||
</PieChart>
|
innerRadius={120}
|
||||||
</Center>
|
outerRadius={230}
|
||||||
<Flex gap={"md"} align={"center"}>
|
label={true}
|
||||||
<Box bg={colors['blue-button']} w={20} h={20} />
|
>
|
||||||
<Text>Sangat Baik: {donutData.find((entry) => entry.name === 'sangatbaik')?.value}</Text>
|
{donutData.map((entry, index) => (
|
||||||
</Flex>
|
<Cell key={`cell-${index}`} fill={entry.color} />
|
||||||
<Flex gap={"md"} align={"center"}>
|
))}
|
||||||
<Box bg={'#10A85AFF'} w={20} h={20} />
|
</Pie>
|
||||||
<Text>Baik: {donutData.find((entry) => entry.name === 'baik')?.value}</Text>
|
</PieChart>
|
||||||
</Flex>
|
</Center>
|
||||||
<Flex gap={"md"} align={"center"}>
|
<Flex gap={"md"} align={"center"}>
|
||||||
<Box bg={'#B3AA12FF'} w={20} h={20} />
|
<Box bg={colors['blue-button']} w={20} h={20} />
|
||||||
<Text>Kurang Baik: {donutData.find((entry) => entry.name === 'kurangbaik')?.value}</Text>
|
<Text>Sangat Baik: {donutData.find((entry) => entry.name === 'sangatbaik')?.value}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex gap={"md"} align={"center"}>
|
<Flex gap={"md"} align={"center"}>
|
||||||
<Box bg={'#B21313FF'} w={20} h={20} />
|
<Box bg={'#10A85AFF'} w={20} h={20} />
|
||||||
<Text>Tidak Baik: {donutData.find((entry) => entry.name === 'tidakbaik')?.value}</Text>
|
<Text>Baik: {donutData.find((entry) => entry.name === 'baik')?.value}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Box>
|
<Flex gap={"md"} align={"center"}>
|
||||||
)}
|
<Box bg={'#B3AA12FF'} w={20} h={20} />
|
||||||
</Stack>
|
<Text>Kurang Baik: {donutData.find((entry) => entry.name === 'kurangbaik')?.value}</Text>
|
||||||
|
</Flex>
|
||||||
|
<Flex gap={"md"} align={"center"}>
|
||||||
|
<Box bg={'#B21313FF'} w={20} h={20} />
|
||||||
|
<Text>Tidak Baik: {donutData.find((entry) => entry.name === 'tidakbaik')?.value}</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import colors from '@/con/colors';
|
import colors from '@/con/colors';
|
||||||
import { Box, Button, Center, Flex, Stack, Text, TextInput, Title } from '@mantine/core';
|
import { Box, Button, Center, Flex, Group, Paper, Stack, Text, TextInput, Title } from '@mantine/core';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useProxy } from 'valtio/utils';
|
import { useProxy } from 'valtio/utils';
|
||||||
import stateGrafikBerdasarkanUmur from '@/app/admin/(dashboard)/_state/ppid/indeks_kepuasan_masyarakat/grafikBerdasarkanUmur';
|
import stateGrafikBerdasarkanUmur from '@/app/admin/(dashboard)/_state/ppid/indeks_kepuasan_masyarakat/grafikBerdasarkanUmur';
|
||||||
@@ -37,117 +37,125 @@ function GrafikBerdasarakanUmur() {
|
|||||||
fetchData();
|
fetchData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
await grafikBerdasarkanUmur.findMany.load();
|
|
||||||
if (grafikBerdasarkanUmur.findMany.data) {
|
|
||||||
updateChartData(grafikBerdasarkanUmur.findMany.data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
try {
|
|
||||||
await grafikBerdasarkanUmur.create.create();
|
|
||||||
await grafikBerdasarkanUmur.findMany.load();
|
await grafikBerdasarkanUmur.findMany.load();
|
||||||
if (grafikBerdasarkanUmur.findMany.data) {
|
if (grafikBerdasarkanUmur.findMany.data) {
|
||||||
updateChartData(grafikBerdasarkanUmur.findMany.data);
|
updateChartData(grafikBerdasarkanUmur.findMany.data);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
console.error("Error submitting data:", error);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
try {
|
||||||
|
await grafikBerdasarkanUmur.create.create();
|
||||||
|
await grafikBerdasarkanUmur.findMany.load();
|
||||||
|
if (grafikBerdasarkanUmur.findMany.data) {
|
||||||
|
updateChartData(grafikBerdasarkanUmur.findMany.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error submitting data:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Box py={15}>
|
<Box py={15}>
|
||||||
<Title order={3}>Grafik Berdasarkan Umur Responden</Title>
|
<Paper bg={colors['white-1']} w={{ base: '100%', md: '50%' }} p={'md'}>
|
||||||
<TextInput
|
<Stack gap={"xs"}>
|
||||||
w={{ base: '100%', md: '50%' }}
|
<Title order={3}>Grafik Berdasarkan Umur Responden</Title>
|
||||||
label="Remaja"
|
<TextInput
|
||||||
placeholder="masukkan jumlah responden remaja"
|
w={{ base: '100%', md: '50%' }}
|
||||||
value={grafikBerdasarkanUmur.create.form.remaja}
|
label="Remaja"
|
||||||
onChange={(val) => {
|
placeholder="masukkan jumlah responden remaja"
|
||||||
grafikBerdasarkanUmur.create.form.remaja = val.currentTarget.value;
|
value={grafikBerdasarkanUmur.create.form.remaja}
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikBerdasarkanUmur.create.form.remaja = val.currentTarget.value;
|
||||||
<TextInput
|
}}
|
||||||
w={{ base: '100%', md: '50%' }}
|
/>
|
||||||
label="Dewasa"
|
<TextInput
|
||||||
placeholder="masukkan jumlah responden dewasa"
|
w={{ base: '100%', md: '50%' }}
|
||||||
value={grafikBerdasarkanUmur.create.form.dewasa}
|
label="Dewasa"
|
||||||
onChange={(val) => {
|
placeholder="masukkan jumlah responden dewasa"
|
||||||
grafikBerdasarkanUmur.create.form.dewasa = val.currentTarget.value;
|
value={grafikBerdasarkanUmur.create.form.dewasa}
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikBerdasarkanUmur.create.form.dewasa = val.currentTarget.value;
|
||||||
<TextInput
|
}}
|
||||||
w={{ base: '100%', md: '50%' }}
|
/>
|
||||||
label="Orangtua"
|
<TextInput
|
||||||
placeholder="masukkan jumlah responden orangtua"
|
w={{ base: '100%', md: '50%' }}
|
||||||
value={grafikBerdasarkanUmur.create.form.orangtua}
|
label="Orangtua"
|
||||||
onChange={(val) => {
|
placeholder="masukkan jumlah responden orangtua"
|
||||||
grafikBerdasarkanUmur.create.form.orangtua = val.currentTarget.value;
|
value={grafikBerdasarkanUmur.create.form.orangtua}
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikBerdasarkanUmur.create.form.orangtua = val.currentTarget.value;
|
||||||
<TextInput
|
}}
|
||||||
w={{ base: '100%', md: '50%' }}
|
/>
|
||||||
label="Lansia"
|
<TextInput
|
||||||
placeholder="masukkan jumlah responden lansia"
|
w={{ base: '100%', md: '50%' }}
|
||||||
value={grafikBerdasarkanUmur.create.form.lansia}
|
label="Lansia"
|
||||||
onChange={(val) => {
|
placeholder="masukkan jumlah responden lansia"
|
||||||
grafikBerdasarkanUmur.create.form.lansia = val.currentTarget.value;
|
value={grafikBerdasarkanUmur.create.form.lansia}
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikBerdasarkanUmur.create.form.lansia = val.currentTarget.value;
|
||||||
<Button
|
}}
|
||||||
mt={10}
|
/>
|
||||||
bg={colors['blue-button']}
|
<Group>
|
||||||
onClick={handleSubmit}
|
<Button
|
||||||
>
|
mt={10}
|
||||||
Submit
|
bg={colors['blue-button']}
|
||||||
</Button>
|
onClick={handleSubmit}
|
||||||
|
>
|
||||||
|
Submit
|
||||||
|
</Button>
|
||||||
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{/* Chart */}
|
{/* Chart */}
|
||||||
<Box>
|
<Box>
|
||||||
<Stack>
|
<Paper bg={colors['white-1']} w={{ base: '100%', md: '50%' }} p={'md'}>
|
||||||
<Title pb={10} order={3}>Grafik Berdasarkan Umur Responden</Title>
|
<Stack>
|
||||||
{mounted && donutData.length > 0 && (
|
<Title pb={10} order={3}>Grafik Berdasarkan Umur Responden</Title>
|
||||||
<Box style={{ width: '100%', height: 'auto', minHeight: 900 }}>
|
{mounted && donutData.length > 0 && (
|
||||||
<Center>
|
<Box style={{ width: '100%', height: 'auto', minHeight: 900 }}>
|
||||||
<PieChart
|
<Center>
|
||||||
width={1000} height={400}
|
<PieChart
|
||||||
data={donutData}
|
width={1000} height={400}
|
||||||
>
|
|
||||||
<Pie
|
|
||||||
dataKey="value"
|
|
||||||
nameKey="name"
|
|
||||||
data={donutData}
|
data={donutData}
|
||||||
innerRadius={120}
|
|
||||||
outerRadius={160}
|
|
||||||
label
|
|
||||||
>
|
>
|
||||||
{donutData.map((entry, index) => (
|
<Pie
|
||||||
<Cell key={`cell-${index}`} fill={entry.color} />
|
dataKey="value"
|
||||||
))}
|
nameKey="name"
|
||||||
</Pie>
|
data={donutData}
|
||||||
</PieChart>
|
innerRadius={120}
|
||||||
</Center>
|
outerRadius={230}
|
||||||
<Flex gap={"md"} align={"center"}>
|
label={true}
|
||||||
<Box bg={colors['blue-button']} w={20} h={20} />
|
>
|
||||||
<Text>17 - 25 tahun: {donutData.find((entry) => entry.name === 'remaja')?.value}</Text>
|
{donutData.map((entry, index) => (
|
||||||
</Flex>
|
<Cell key={`cell-${index}`} fill={entry.color} />
|
||||||
<Flex gap={"md"} align={"center"}>
|
))}
|
||||||
<Box bg={'#D32711FF'} w={20} h={20} />
|
</Pie>
|
||||||
<Text>26 - 45 tahun: {donutData.find((entry) => entry.name === 'dewasa')?.value}</Text>
|
</PieChart>
|
||||||
</Flex>
|
</Center>
|
||||||
<Flex gap={"md"} align={"center"}>
|
<Flex gap={"md"} align={"center"}>
|
||||||
<Box bg={'#B46B04FF'} w={20} h={20} />
|
<Box bg={colors['blue-button']} w={20} h={20} />
|
||||||
<Text>46 - 60 tahun: {donutData.find((entry) => entry.name === 'orangtua')?.value}</Text>
|
<Text>17 - 25 tahun: {donutData.find((entry) => entry.name === 'remaja')?.value}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex gap={"md"} align={"center"}>
|
<Flex gap={"md"} align={"center"}>
|
||||||
<Box bg={'#038617FF'} w={20} h={20} />
|
<Box bg={'#D32711FF'} w={20} h={20} />
|
||||||
<Text>di atas 60 tahun: {donutData.find((entry) => entry.name === 'lansia')?.value}</Text>
|
<Text>26 - 45 tahun: {donutData.find((entry) => entry.name === 'dewasa')?.value}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Box>
|
<Flex gap={"md"} align={"center"}>
|
||||||
)}
|
<Box bg={'#B46B04FF'} w={20} h={20} />
|
||||||
</Stack>
|
<Text>46 - 60 tahun: {donutData.find((entry) => entry.name === 'orangtua')?.value}</Text>
|
||||||
|
</Flex>
|
||||||
|
<Flex gap={"md"} align={"center"}>
|
||||||
|
<Box bg={'#038617FF'} w={20} h={20} />
|
||||||
|
<Text>di atas 60 tahun: {donutData.find((entry) => entry.name === 'lansia')?.value}</Text>
|
||||||
|
</Flex>
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import stateGrafikHasilKepuasanMasyarakat from '@/app/admin/(dashboard)/_state/ppid/indeks_kepuasan_masyarakat/grafikHasilKepuasan';
|
import stateGrafikHasilKepuasanMasyarakat from '@/app/admin/(dashboard)/_state/ppid/indeks_kepuasan_masyarakat/grafikHasilKepuasan';
|
||||||
import colors from '@/con/colors';
|
import colors from '@/con/colors';
|
||||||
import { Box, Button, TextInput, Title } from '@mantine/core';
|
import { Box, Button, Paper, Stack, TextInput, Title } from '@mantine/core';
|
||||||
import { useMediaQuery, useShallowEffect } from '@mantine/hooks';
|
import { useMediaQuery, useShallowEffect } from '@mantine/hooks';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Bar, BarChart, Legend, Tooltip, XAxis, YAxis } from 'recharts';
|
import { Bar, BarChart, Legend, Tooltip, XAxis, YAxis } from 'recharts';
|
||||||
@@ -32,53 +32,61 @@ function GrafikHasilKepuasan() {
|
|||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Box py={15}>
|
<Box py={15}>
|
||||||
<Title order={3}>Grafik Hasil Kepuasan Masyarakat Terhadap Pelayanan Publik</Title>
|
<Paper bg={colors['white-1']} w={{ base: '100%', md: '50%' }} p={'md'}>
|
||||||
<TextInput
|
<Stack>
|
||||||
w={{ base: '100%', md: '50%' }}
|
<Title order={3}>Grafik Hasil Kepuasan Masyarakat Terhadap Pelayanan Publik</Title>
|
||||||
label="Label"
|
<TextInput
|
||||||
placeholder="masukkan label"
|
w={{ base: '100%', md: '50%' }}
|
||||||
value={grafikHasilKepuasan.create.form.label}
|
label="Label"
|
||||||
onChange={(val) => {
|
placeholder="masukkan label"
|
||||||
grafikHasilKepuasan.create.form.label = val.currentTarget.value;
|
value={grafikHasilKepuasan.create.form.label}
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikHasilKepuasan.create.form.label = val.currentTarget.value;
|
||||||
<TextInput
|
}}
|
||||||
w={{ base: '100%', md: '50%' }}
|
/>
|
||||||
label="Jumlah Kepuasan"
|
<TextInput
|
||||||
type="number"
|
w={{ base: '100%', md: '50%' }}
|
||||||
placeholder="masukkan jumlah kepuasan"
|
label="Jumlah Kepuasan"
|
||||||
value={grafikHasilKepuasan.create.form.kepuasan}
|
type="number"
|
||||||
onChange={(val) => {
|
placeholder="masukkan jumlah kepuasan"
|
||||||
grafikHasilKepuasan.create.form.kepuasan = val.currentTarget.value;
|
value={grafikHasilKepuasan.create.form.kepuasan}
|
||||||
}}
|
onChange={(val) => {
|
||||||
/>
|
grafikHasilKepuasan.create.form.kepuasan = val.currentTarget.value;
|
||||||
<Button
|
}}
|
||||||
mt={10}
|
/>
|
||||||
bg={colors['blue-button']}
|
<Button
|
||||||
onClick={async () => {
|
mt={10}
|
||||||
await grafikHasilKepuasan.create.create();
|
bg={colors['blue-button']}
|
||||||
await grafikHasilKepuasan.findMany.load();
|
onClick={async () => {
|
||||||
if (grafikHasilKepuasan.findMany.data) {
|
await grafikHasilKepuasan.create.create();
|
||||||
setChartData(grafikHasilKepuasan.findMany.data);
|
await grafikHasilKepuasan.findMany.load();
|
||||||
}
|
if (grafikHasilKepuasan.findMany.data) {
|
||||||
}}
|
setChartData(grafikHasilKepuasan.findMany.data);
|
||||||
>
|
}
|
||||||
Submit
|
}}
|
||||||
</Button>
|
>
|
||||||
|
Submit
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
{/* Chart */}
|
{/* Chart */}
|
||||||
<Box style={{ width: '100%', minWidth: 300, height: 400, minHeight: 300 }}>
|
<Box style={{ width: '100%', minWidth: 300, height: 400, minHeight: 300 }}>
|
||||||
<Title pb={10} order={3}>Data Kepuasan Masyarakat</Title>
|
<Paper style={{ width: '100%', minWidth: 300, height: 400, minHeight: 300 }} bg={colors['white-1']} p={'md'}>
|
||||||
{mounted && chartData.length > 0 && (
|
<Stack gap={"xs"}>
|
||||||
<BarChart width={isMobile ? 450 : isTablet ? 600 : 900} height={380} data={chartData} >
|
<Title pb={10} order={3}>Data Kepuasan Masyarakat</Title>
|
||||||
<XAxis dataKey="label" />
|
{mounted && chartData.length > 0 && (
|
||||||
<YAxis />
|
<BarChart width={isMobile ? 300 : isTablet ? 600 : 900} height={380} data={chartData} >
|
||||||
<Tooltip />
|
<XAxis dataKey="label" />
|
||||||
<Legend />
|
<YAxis />
|
||||||
<Bar dataKey="kepuasan" fill={colors['blue-button']} name="Kepuasan" />
|
<Tooltip />
|
||||||
</BarChart>
|
<Legend />
|
||||||
)}
|
<Bar dataKey="kepuasan" fill={colors['blue-button']} name="Kepuasan" />
|
||||||
|
</BarChart>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
import React from 'react';
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import statePermohonanInformasi from '../../_state/ppid/permohonan_informasi_publik/permohonanInformasiPublik';
|
||||||
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
|
import { Group, Select, Skeleton } from '@mantine/core';
|
||||||
|
|
||||||
|
function JenisInformasi({ onChange }: {
|
||||||
|
onChange: (value: Prisma.JenisInformasiDimintaGetPayload<{
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
name: true
|
||||||
|
}
|
||||||
|
}>) => void
|
||||||
|
}) {
|
||||||
|
const jenisInformasiState = useProxy(statePermohonanInformasi.jenisInformasiDiminta)
|
||||||
|
useShallowEffect(() => {
|
||||||
|
jenisInformasiState.findMany.load()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
if (!jenisInformasiState.findMany.data) return <Skeleton h={40} />
|
||||||
|
return (
|
||||||
|
<Group>
|
||||||
|
<Select
|
||||||
|
placeholder='pilih jenis informasi'
|
||||||
|
label={'select jenis informasi'}
|
||||||
|
data={jenisInformasiState.findMany.data.map((item) => ({
|
||||||
|
value: item.id,
|
||||||
|
label: item.name
|
||||||
|
}))}
|
||||||
|
onChange={(v) => {
|
||||||
|
const data = jenisInformasiState.findMany.data?.find((item) => item.id === v)
|
||||||
|
if (!data) return
|
||||||
|
onChange(data)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default JenisInformasi;
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import { Group, Select } from '@mantine/core';
|
||||||
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
import React from 'react';
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import statePermohonanInformasi from '../../_state/ppid/permohonan_informasi_publik/permohonanInformasiPublik';
|
||||||
|
|
||||||
|
function MemperolehInformasi({ onChange }: {
|
||||||
|
onChange: (value: Prisma.CaraMemperolehInformasiGetPayload<{
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
name: true
|
||||||
|
}
|
||||||
|
}>) => void
|
||||||
|
}) {
|
||||||
|
const memperolehInformasiState = useProxy(statePermohonanInformasi.caraMemperolehInformasi)
|
||||||
|
|
||||||
|
useShallowEffect(() => {
|
||||||
|
memperolehInformasiState.findMany.load()
|
||||||
|
}, [])
|
||||||
|
return (
|
||||||
|
<Group>
|
||||||
|
<Select
|
||||||
|
placeholder='pilih katagori'
|
||||||
|
label={"select katagori"}
|
||||||
|
data={memperolehInformasiState.findMany.data?.map((item) => ({
|
||||||
|
value: item.id,
|
||||||
|
label: item.name
|
||||||
|
}))} onChange={(v) => {
|
||||||
|
const data = memperolehInformasiState.findMany.data?.find((item) => item.id === v)
|
||||||
|
if (!data) return
|
||||||
|
onChange(data)
|
||||||
|
}} />
|
||||||
|
</Group>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MemperolehInformasi;
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import { Group, Select, Skeleton } from '@mantine/core';
|
||||||
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
import React from 'react';
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import statePermohonanInformasi from '../../_state/ppid/permohonan_informasi_publik/permohonanInformasiPublik';
|
||||||
|
|
||||||
|
function MemperolehSalinan({ onChange }: {
|
||||||
|
onChange: (value: Prisma.CaraMemperolehSalinanInformasiGetPayload<{
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
name: true
|
||||||
|
}
|
||||||
|
}>) => void
|
||||||
|
}) {
|
||||||
|
const memperolehSalinanInformasiState = useProxy(statePermohonanInformasi.caraMemperolehSalinanInformasi)
|
||||||
|
useShallowEffect(() => {
|
||||||
|
memperolehSalinanInformasiState.findMany.load()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
if (!memperolehSalinanInformasiState.findMany.data) return <Skeleton h={40} />
|
||||||
|
return (
|
||||||
|
<Group>
|
||||||
|
<Select
|
||||||
|
placeholder='pilih salinan informasi'
|
||||||
|
label={'select salinan informasi'}
|
||||||
|
data={memperolehSalinanInformasiState.findMany.data.map((item) => ({
|
||||||
|
value: item.id,
|
||||||
|
label: item.name
|
||||||
|
}))}
|
||||||
|
onChange={(v) => {
|
||||||
|
if (!v) return
|
||||||
|
const selectedItem = memperolehSalinanInformasiState.findMany.data?.find(item => item.id === v)
|
||||||
|
if (selectedItem) {
|
||||||
|
onChange({
|
||||||
|
id: selectedItem.id,
|
||||||
|
name: selectedItem.name
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Group>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default MemperolehSalinan;
|
||||||
@@ -1,11 +1,115 @@
|
|||||||
import React from 'react';
|
'use client'
|
||||||
|
import { Box, Button, Group, Paper, SimpleGrid, Stack, TextInput, Title } from '@mantine/core';
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import statePermohonanInformasi from '../../_state/ppid/permohonan_informasi_publik/permohonanInformasiPublik';
|
||||||
|
import JenisInformasi from './jenisInformasi';
|
||||||
|
import MemperolehInformasi from './memperolehInformasi';
|
||||||
|
import MemperolehSalinan from './memperolehSalinan';
|
||||||
|
import colors from '@/con/colors';
|
||||||
|
|
||||||
function Page() {
|
function Page() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<Box>
|
||||||
permohonan-informasi-publik
|
<Stack>
|
||||||
</div>
|
<SimpleGrid cols={{ base: 1, md: 2 }}>
|
||||||
|
<PermohonanInformasiPublikCreate />
|
||||||
|
</SimpleGrid>
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Page;
|
function PermohonanInformasiPublikCreate() {
|
||||||
|
const permohonanInformasiPublikState = useProxy(statePermohonanInformasi)
|
||||||
|
const submitForms = () => {
|
||||||
|
// Tambahkan log untuk debugging
|
||||||
|
console.log("Form data sebelum submit:", {
|
||||||
|
name: permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.name,
|
||||||
|
nik: permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.nik,
|
||||||
|
notelp: permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.notelp,
|
||||||
|
alamat: permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.alamat,
|
||||||
|
email: permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.email,
|
||||||
|
jenisInformasiDimintaId: permohonanInformasiPublikState.jenisInformasiDiminta,
|
||||||
|
caraMemperolehInformasiId: permohonanInformasiPublikState.caraMemperolehInformasi,
|
||||||
|
caraMemperolehSalinanInformasiId: permohonanInformasiPublikState.caraMemperolehSalinanInformasi
|
||||||
|
});
|
||||||
|
|
||||||
|
if (permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.name &&
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.nik &&
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.notelp &&
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.alamat &&
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.email &&
|
||||||
|
permohonanInformasiPublikState.jenisInformasiDiminta &&
|
||||||
|
permohonanInformasiPublikState.caraMemperolehInformasi &&
|
||||||
|
permohonanInformasiPublikState.caraMemperolehSalinanInformasi) {
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.create()
|
||||||
|
} else {
|
||||||
|
console.log("Validasi gagal, form tidak lengkap");
|
||||||
|
// Tampilkan pesan error ke pengguna di sini
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Box py={5}>
|
||||||
|
<Paper bg={colors['white-1']} p={'md'}>
|
||||||
|
<Stack gap={"10"}>
|
||||||
|
<Title order={3}>Permohonan Informasi Publik</Title>
|
||||||
|
<TextInput
|
||||||
|
label="Nama Lengkap"
|
||||||
|
placeholder="masukkan nama lengkap"
|
||||||
|
onChange={(val) => {
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.name = val.target.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="NIK"
|
||||||
|
placeholder="masukkan NIK"
|
||||||
|
onChange={(val) => {
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.nik = val.target.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="No.Telp"
|
||||||
|
placeholder="masukkan no telp"
|
||||||
|
onChange={(val) => {
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.notelp = val.target.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="Alamat"
|
||||||
|
placeholder="masukkan alamat"
|
||||||
|
onChange={(val) => {
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.alamat = val.target.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="Email"
|
||||||
|
placeholder="masukkan email"
|
||||||
|
onChange={(val) => {
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.email = val.target.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<JenisInformasi
|
||||||
|
onChange={(val) => {
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.jenisInformasiDimintaId = val.id
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<MemperolehInformasi
|
||||||
|
onChange={(val) => {
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.caraMemperolehInformasiId = val.id
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<MemperolehSalinan
|
||||||
|
onChange={(val) => {
|
||||||
|
permohonanInformasiPublikState.permohonanInformasiPublikForm.create.form.caraMemperolehSalinanInformasiId = val.id
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Group>
|
||||||
|
<Button onClick={submitForms}>Submit</Button>
|
||||||
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</Box >
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Page;
|
||||||
@@ -1,11 +1,98 @@
|
|||||||
|
'use client'
|
||||||
|
import colors from '@/con/colors';
|
||||||
|
import { Box, Button, Group, Paper, SimpleGrid, Skeleton, Stack, Text, TextInput, Title } from '@mantine/core';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import statePermohonanKeberatan from '../../_state/ppid/permohonan_keberatan_informasi_publik/permohonanKeberatanInformasi';
|
||||||
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
|
|
||||||
function Page() {
|
function Page() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<Box>
|
||||||
permohonan-keberatan-informasi-publik
|
<SimpleGrid cols={{ base: 1, md: 2 }}>
|
||||||
</div>
|
<PermohonanKeberatanInformasiCreate />
|
||||||
|
<PermohonanKeberatanInformasiList />
|
||||||
|
</SimpleGrid>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function PermohonanKeberatanInformasiCreate() {
|
||||||
|
const state = useProxy(statePermohonanKeberatan.permohonanKeberatanInformasiForm)
|
||||||
|
const submit = () => {
|
||||||
|
if (state.create.form.name && state.create.form.email && state.create.form.notelp && state.create.form.alasan) {
|
||||||
|
state.create.create()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Box py={10}>
|
||||||
|
<Paper bg={colors['white-1']} p={'md'}>
|
||||||
|
<Stack gap={"xs"}>
|
||||||
|
<Title order={3}>Permohonan Keberatan Informasi Publik</Title>
|
||||||
|
<TextInput
|
||||||
|
label="Nama"
|
||||||
|
placeholder="masukkan nama lengkap"
|
||||||
|
onChange={(val) => {
|
||||||
|
state.create.form.name = val.target.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="Email"
|
||||||
|
placeholder="masukkan email"
|
||||||
|
onChange={(val) => {
|
||||||
|
state.create.form.email = val.target.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="Nomor Telepon"
|
||||||
|
placeholder="masukkan nomor telepon"
|
||||||
|
onChange={(val) => {
|
||||||
|
state.create.form.notelp = val.target.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="Alasan Keberatan"
|
||||||
|
placeholder="masukkan alasan keberatan"
|
||||||
|
onChange={(val) => {
|
||||||
|
state.create.form.alasan = val.target.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Group>
|
||||||
|
<Button onClick={submit} bg={colors['blue-button']}>Kirim Permohonan</Button>
|
||||||
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function PermohonanKeberatanInformasiList() {
|
||||||
|
const listState = useProxy(statePermohonanKeberatan.permohonanKeberatanInformasiForm)
|
||||||
|
useShallowEffect(() => {
|
||||||
|
listState.findMany.load()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
if (!listState.findMany.data) return <Stack>
|
||||||
|
{Array.from({ length: 10 }).map((v, k) => <Skeleton key={k} h={40} />)}
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box py={10}>
|
||||||
|
<Paper bg={colors['white-1']} p={'md'}>
|
||||||
|
<Stack gap={"xs"}>
|
||||||
|
<Title order={3}>Permohonan Keberatan Informasi Publik</Title>
|
||||||
|
{listState.findMany.data?.map((item) => (
|
||||||
|
<Box key={item.id}>
|
||||||
|
<Text>Nama: {item.name}</Text>
|
||||||
|
<Text>Email: {item.email}</Text>
|
||||||
|
<Text>Telepon: {item.notelp}</Text>
|
||||||
|
<Text>Alasan: {item.alasan}</Text>
|
||||||
|
</Box>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
24
src/app/admin/(dashboard)/ppid/profile-ppid/biodata/page.tsx
Normal file
24
src/app/admin/(dashboard)/ppid/profile-ppid/biodata/page.tsx
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
'use client'
|
||||||
|
import { Box, Text } from '@mantine/core';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import stateProfilePPID from '../../../_state/ppid/profile_ppid/profile_PPID';
|
||||||
|
import { PPIDEditor } from '../../_com/ppid_Editor';
|
||||||
|
|
||||||
|
function Biodata() {
|
||||||
|
const biodataState = useProxy(stateProfilePPID.profilePPID)
|
||||||
|
return (<Box>
|
||||||
|
<Text fw={"bold"}>Biodata</Text>
|
||||||
|
<PPIDEditor
|
||||||
|
showSubmit={false}
|
||||||
|
onChange={(val) => {
|
||||||
|
biodataState.create.form.biodata = val
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Biodata;
|
||||||
@@ -1,11 +1,102 @@
|
|||||||
import React from 'react';
|
'use client'
|
||||||
|
import colors from '@/con/colors';
|
||||||
|
import { Box, Button, Group, Paper, SimpleGrid, Skeleton, Stack, Text, TextInput, Title } from '@mantine/core';
|
||||||
|
import Biodata from './biodata/page';
|
||||||
|
import PengalamanOrganisasi from './pengalaman_organisasi/page';
|
||||||
|
import RiwayatKarir from './riwayat_karir/page';
|
||||||
|
import ProgramKerjaUnggulan from './program_kerja_unggulan/page';
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import stateProfilePPID from '../../_state/ppid/profile_ppid/profile_PPID';
|
||||||
|
import { useShallowEffect } from '@mantine/hooks';
|
||||||
|
|
||||||
|
|
||||||
function Page() {
|
function Page() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<Box>
|
||||||
profile-ppid
|
<SimpleGrid cols={{ base: 1, md: 2 }}>
|
||||||
</div>
|
<ProfileCreate />
|
||||||
|
<ProfileList />
|
||||||
|
</SimpleGrid>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ProfileCreate() {
|
||||||
|
const allState = useProxy(stateProfilePPID)
|
||||||
|
const submit = () => {
|
||||||
|
if (
|
||||||
|
allState.profilePPID.create.form.name &&
|
||||||
|
allState.profilePPID.create.form.biodata &&
|
||||||
|
allState.profilePPID.create.form.riwayat &&
|
||||||
|
allState.profilePPID.create.form.pengalaman &&
|
||||||
|
allState.profilePPID.create.form.unggulan) {
|
||||||
|
allState.profilePPID.create.create()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Paper bg={colors['white-1']} p={'md'} radius={10}>
|
||||||
|
<Stack gap={"xs"}>
|
||||||
|
<Title order={3}>Profile PPID</Title>
|
||||||
|
<TextInput
|
||||||
|
label={<Text fw={"bold"}>Nama Perbekel</Text>}
|
||||||
|
placeholder="masukkan nama perbekel"
|
||||||
|
onChange={(val) => {
|
||||||
|
allState.profilePPID.create.form.name = val.currentTarget.value
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Biodata />
|
||||||
|
<RiwayatKarir />
|
||||||
|
<PengalamanOrganisasi />
|
||||||
|
<ProgramKerjaUnggulan />
|
||||||
|
<Group>
|
||||||
|
<Button bg={colors['blue-button']} onClick={submit}>Submit</Button>
|
||||||
|
</Group>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function ProfileList() {
|
||||||
|
const allList = useProxy(stateProfilePPID)
|
||||||
|
useShallowEffect(() => {
|
||||||
|
allList.profilePPID.findMany.load()
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
if (!allList.profilePPID.findMany.data) return <Stack>
|
||||||
|
{Array.from({ length: 10 }).map((v, k) => <Skeleton key={k} h={40} />)}
|
||||||
|
</Stack>
|
||||||
|
return (
|
||||||
|
<Paper bg={colors['white-1']} p={'md'}>
|
||||||
|
<Stack gap={"xs"}>
|
||||||
|
<Title order={3}>List Profile PPID</Title>
|
||||||
|
{allList.profilePPID.findMany.data?.map((item) => (
|
||||||
|
<Box key={item.id}>
|
||||||
|
<Box>
|
||||||
|
<Text fw={"bold"}>Nama</Text>
|
||||||
|
<Text dangerouslySetInnerHTML={{ __html: item.name }}></Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text fw={"bold"}>Biodata</Text>
|
||||||
|
<Text dangerouslySetInnerHTML={{ __html: item.biodata }}></Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text fw={"bold"}>Riwayat</Text>
|
||||||
|
<Text dangerouslySetInnerHTML={{ __html: item.riwayat }}></Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text fw={"bold"}>Pengalaman</Text>
|
||||||
|
<Text dangerouslySetInnerHTML={{ __html: item.pengalaman }}></Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text fw={"bold"}>Program Kerja Unggulan</Text>
|
||||||
|
<Text dangerouslySetInnerHTML={{ __html: item.unggulan }}></Text>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
'use client'
|
||||||
|
import { Box, Text } from '@mantine/core';
|
||||||
|
import React from 'react';
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import stateProfilePPID from '../../../_state/ppid/profile_ppid/profile_PPID';
|
||||||
|
import { PPIDEditor } from '../../_com/ppid_Editor';
|
||||||
|
|
||||||
|
function PengalamanOrganisasi() {
|
||||||
|
const pengalamanOrganisasiState = useProxy(stateProfilePPID.profilePPID)
|
||||||
|
return (<Box>
|
||||||
|
<Text fw={"bold"}>Pengalaman Organisasi</Text>
|
||||||
|
<PPIDEditor
|
||||||
|
showSubmit={false}
|
||||||
|
onChange={(val) => {
|
||||||
|
pengalamanOrganisasiState.create.form.pengalaman = val
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PengalamanOrganisasi;
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
'use client'
|
||||||
|
import { Box, Text } from '@mantine/core';
|
||||||
|
import React from 'react';
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import stateProfilePPID from '../../../_state/ppid/profile_ppid/profile_PPID';
|
||||||
|
import { PPIDEditor } from '../../_com/ppid_Editor';
|
||||||
|
|
||||||
|
function ProgramKerjaUnggulan() {
|
||||||
|
const programKerjaUnggulanState = useProxy(stateProfilePPID.profilePPID)
|
||||||
|
return (<Box>
|
||||||
|
<Text fw={"bold"}>Program Kerja Unggulan</Text>
|
||||||
|
<PPIDEditor
|
||||||
|
showSubmit={false}
|
||||||
|
onChange={(val) => {
|
||||||
|
programKerjaUnggulanState.create.form.unggulan = val
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ProgramKerjaUnggulan;
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Box, Text } from '@mantine/core';
|
||||||
|
import React from 'react';
|
||||||
|
import { useProxy } from 'valtio/utils';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
|
import stateProfilePPID from '../../../_state/ppid/profile_ppid/profile_PPID';
|
||||||
|
|
||||||
|
// ini penting
|
||||||
|
const PPIDEditor = dynamic(() => import('../../_com/ppid_Editor').then(mod => mod.PPIDEditor), {
|
||||||
|
ssr: false, // disable server side rendering
|
||||||
|
});
|
||||||
|
|
||||||
|
function RiwayatKarir() {
|
||||||
|
const biodataState = useProxy(stateProfilePPID.profilePPID);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box>
|
||||||
|
<Text fw={"bold"}>Riwayat Karir</Text>
|
||||||
|
<PPIDEditor
|
||||||
|
showSubmit={false}
|
||||||
|
onChange={(val) => {
|
||||||
|
biodataState.create.form.riwayat = val;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default RiwayatKarir;
|
||||||
@@ -4,14 +4,25 @@ import GrafikHasilKepuasanMasyarakat from "./ikm/grafik_hasil_kepuasan_masyaraka
|
|||||||
import GrafikBerdasarkanJenisKelamin from "./ikm/grafik_berdasarkan_jenis_kelamin";
|
import GrafikBerdasarkanJenisKelamin from "./ikm/grafik_berdasarkan_jenis_kelamin";
|
||||||
import GrafikBerdasarkanResponden from "./ikm/grafik_responden";
|
import GrafikBerdasarkanResponden from "./ikm/grafik_responden";
|
||||||
import GrafikBerdasarkanUmur from "./ikm/grafik_berdasarkan_umur";
|
import GrafikBerdasarkanUmur from "./ikm/grafik_berdasarkan_umur";
|
||||||
|
import PermohonanInformasiPublik from "./permohonan_informasi_publik";
|
||||||
|
import PermohonanKeberatanInformasiPublik from "./permohonan_keberatan_informasi_publik";
|
||||||
|
import ProfilePPID from "./profile_ppid";
|
||||||
|
import VisiMisiPPID from "./visi_misi_ppid";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const PPID = new Elysia({ prefix: "/api/ppid", tags: ["PPID"] })
|
const PPID = new Elysia({ prefix: "/api/ppid", tags: ["PPID"] })
|
||||||
|
.use(ProfilePPID)
|
||||||
.use(DaftarInformasiPublik)
|
.use(DaftarInformasiPublik)
|
||||||
.use(GrafikHasilKepuasanMasyarakat)
|
.use(GrafikHasilKepuasanMasyarakat)
|
||||||
.use(GrafikBerdasarkanJenisKelamin)
|
.use(GrafikBerdasarkanJenisKelamin)
|
||||||
.use(GrafikBerdasarkanResponden)
|
.use(GrafikBerdasarkanResponden)
|
||||||
.use(GrafikBerdasarkanUmur)
|
.use(GrafikBerdasarkanUmur)
|
||||||
|
.use(PermohonanInformasiPublik)
|
||||||
|
.use(PermohonanKeberatanInformasiPublik)
|
||||||
|
.use(VisiMisiPPID)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
import { Prisma } from "@prisma/client";
|
||||||
|
import { Context } from "elysia";
|
||||||
|
|
||||||
|
type FormCreate = Prisma.PermohonanInformasiPublikGetPayload<{
|
||||||
|
select: {
|
||||||
|
name: true;
|
||||||
|
nik: true;
|
||||||
|
email: true;
|
||||||
|
notelp: true;
|
||||||
|
alamat: true;
|
||||||
|
jenisInformasiDimintaId: true;
|
||||||
|
caraMemperolehInformasiId: true;
|
||||||
|
caraMemperolehSalinanInformasiId: true;
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
export default async function permohonanInformasiPublikCreate(context: Context) {
|
||||||
|
const body = context.body as FormCreate;
|
||||||
|
|
||||||
|
await prisma.permohonanInformasiPublik.create({
|
||||||
|
data: {
|
||||||
|
name: body.name,
|
||||||
|
nik: body.nik,
|
||||||
|
email: body.email,
|
||||||
|
notelp: body.notelp,
|
||||||
|
alamat: body.alamat,
|
||||||
|
jenisInformasiDimintaId: body.jenisInformasiDimintaId,
|
||||||
|
caraMemperolehInformasiId: body.caraMemperolehInformasiId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
message: "Permohonan Informasi Publik Berhasil Dibuat",
|
||||||
|
data: {
|
||||||
|
...body,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export default async function permohonanInformasiPublikFindMany() {
|
||||||
|
const res = await prisma.permohonanInformasiPublik.findMany();
|
||||||
|
return {
|
||||||
|
data: res,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import Elysia, { t } from "elysia";
|
||||||
|
import permohonanInformasiPublikCreate from "./create";
|
||||||
|
import permohonanInformasiPublikFindMany from "./find-many";
|
||||||
|
import jenisInformasiFindMany from "./jenisInformasi";
|
||||||
|
import memperolehInformasiFindMany from "./memperolehInformasi";
|
||||||
|
import salinanInformasiFindMany from "./salinanInformasi";
|
||||||
|
|
||||||
|
const PermohonanInformasiPublik = new Elysia({
|
||||||
|
prefix: "/permohonaninformasipublik",
|
||||||
|
tags: ["PPID/Permohonan Informasi Publik"]
|
||||||
|
})
|
||||||
|
.get("/jenisInformasi/find-many", jenisInformasiFindMany)
|
||||||
|
.get("/memperolehInformasi/find-many", memperolehInformasiFindMany)
|
||||||
|
.get("/salinanInformasi/find-many", salinanInformasiFindMany)
|
||||||
|
.get("/find-many", permohonanInformasiPublikFindMany)
|
||||||
|
.post("/create", permohonanInformasiPublikCreate, {
|
||||||
|
body: t.Object({
|
||||||
|
name: t.String(),
|
||||||
|
nik: t.String(),
|
||||||
|
notelp: t.String(),
|
||||||
|
alamat: t.String(),
|
||||||
|
email: t.String(),
|
||||||
|
jenisInformasiDimintaId: t.Union([t.String(), t.Null()]),
|
||||||
|
caraMemperolehInformasiId: t.Union([t.String(), t.Null()]),
|
||||||
|
caraMemperolehSalinanInformasiId: t.Union([t.String(), t.Null()]),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
export default PermohonanInformasiPublik
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export default async function jenisInformasiFindMany() {
|
||||||
|
const res = await prisma.jenisInformasiDiminta.findMany();
|
||||||
|
return {
|
||||||
|
data: res,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export default async function memperolehInformasiFindMany() {
|
||||||
|
const res = await prisma.caraMemperolehInformasi.findMany();
|
||||||
|
return {
|
||||||
|
data: res,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export default async function salinanInformasiFindMany() {
|
||||||
|
const res = await prisma.caraMemperolehSalinanInformasi.findMany();
|
||||||
|
return {
|
||||||
|
data: res,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
import { Prisma } from "@prisma/client";
|
||||||
|
import { Context } from "elysia";
|
||||||
|
|
||||||
|
type FormCreate = Prisma.FormulirPermohonanKeberatanGetPayload<{
|
||||||
|
select: {
|
||||||
|
name: true;
|
||||||
|
email: true;
|
||||||
|
notelp: true;
|
||||||
|
alasan: true;
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
|
||||||
|
export default async function permohonanKeberatanInformasiPublikCreate(context: Context) {
|
||||||
|
const body = context.body as FormCreate;
|
||||||
|
|
||||||
|
await prisma.formulirPermohonanKeberatan.create({
|
||||||
|
data: {
|
||||||
|
name: body.name,
|
||||||
|
email: body.email,
|
||||||
|
notelp: body.notelp,
|
||||||
|
alasan: body.alasan,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
message: "Permohonan Keberatan Informasi Publik Berhasil Dibuat",
|
||||||
|
data: {
|
||||||
|
...body,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export default async function permohonanKeberatanInformasiPublikFindMany() {
|
||||||
|
const res = await prisma.formulirPermohonanKeberatan.findMany();
|
||||||
|
return {
|
||||||
|
data: res,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import Elysia, { t } from "elysia";
|
||||||
|
import permohonanKeberatanInformasiPublikCreate from "./create";
|
||||||
|
import permohonanKeberatanInformasiPublikFindMany from "./find-many";
|
||||||
|
|
||||||
|
const PermohonanKeberatanInformasiPublik = new Elysia({
|
||||||
|
prefix: "/permohonankeberataninformasipublik",
|
||||||
|
tags: ["PPID/Permohonan Keberatan Informasi Publik"],
|
||||||
|
})
|
||||||
|
.get("/find-many", permohonanKeberatanInformasiPublikFindMany)
|
||||||
|
.post("/create", permohonanKeberatanInformasiPublikCreate, {
|
||||||
|
body: t.Object({
|
||||||
|
name: t.String(),
|
||||||
|
email: t.String(),
|
||||||
|
notelp: t.String(),
|
||||||
|
alasan: t.String(),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
export default PermohonanKeberatanInformasiPublik;
|
||||||
34
src/app/api/[[...slugs]]/_lib/ppid/profile_ppid/create.ts
Normal file
34
src/app/api/[[...slugs]]/_lib/ppid/profile_ppid/create.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
import { Prisma } from "@prisma/client";
|
||||||
|
import { Context } from "elysia";
|
||||||
|
|
||||||
|
type FormCreate = Prisma.ProfilePPIDGetPayload<{
|
||||||
|
select: {
|
||||||
|
name: true;
|
||||||
|
biodata: true;
|
||||||
|
riwayat: true;
|
||||||
|
pengalaman: true;
|
||||||
|
unggulan: true;
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
export default async function profilePPIDCreate(context: Context) {
|
||||||
|
const body = context.body as FormCreate;
|
||||||
|
|
||||||
|
await prisma.profilePPID.create({
|
||||||
|
data: {
|
||||||
|
name: body.name,
|
||||||
|
biodata: body.biodata,
|
||||||
|
riwayat: body.riwayat,
|
||||||
|
pengalaman: body.pengalaman,
|
||||||
|
unggulan: body.unggulan,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
message: "Profile PPID Berhasil Dibuat",
|
||||||
|
data: {
|
||||||
|
...body,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export default async function profilePPIDFindMany() {
|
||||||
|
const res = await prisma.profilePPID.findMany();
|
||||||
|
return{
|
||||||
|
data: res
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
21
src/app/api/[[...slugs]]/_lib/ppid/profile_ppid/index.ts
Normal file
21
src/app/api/[[...slugs]]/_lib/ppid/profile_ppid/index.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import Elysia, { t } from "elysia";
|
||||||
|
import profilePPIDCreate from "./create";
|
||||||
|
import profilePPIDFindMany from "./find-many";
|
||||||
|
|
||||||
|
const ProfilePPID = new Elysia({
|
||||||
|
prefix: "/profileppid",
|
||||||
|
tags: ["PPID/Profile PPID"]
|
||||||
|
})
|
||||||
|
.get("/find-many", profilePPIDFindMany)
|
||||||
|
.post("/create", profilePPIDCreate, {
|
||||||
|
body: t.Object({
|
||||||
|
name: t.String(),
|
||||||
|
biodata: t.String(),
|
||||||
|
riwayat: t.String(),
|
||||||
|
pengalaman: t.String(),
|
||||||
|
unggulan: t.String(),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
export default ProfilePPID;
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import Elysia from "elysia";
|
||||||
|
import MisiPPID from "./misi_ppid";
|
||||||
|
|
||||||
|
const VisiMisiPPID = new Elysia({ prefix: "/visimisippid", tags: ["PPID/Visi Misi PPID"] })
|
||||||
|
.use(MisiPPID)
|
||||||
|
|
||||||
|
export default VisiMisiPPID
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
import { Prisma } from "@prisma/client";
|
||||||
|
import { Context } from "elysia";
|
||||||
|
|
||||||
|
type FormCreate = Prisma.MisiPPIDGetPayload<{
|
||||||
|
select: {
|
||||||
|
content: true;
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
|
||||||
|
export default async function misiPPIDCreate(context: Context) {
|
||||||
|
const body = context.body as FormCreate;
|
||||||
|
|
||||||
|
await prisma.misiPPID.create({
|
||||||
|
data: {
|
||||||
|
content: body.content,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
message: "Misi PPID Berhasil Dibuat",
|
||||||
|
data: {
|
||||||
|
...body,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
import { Context } from "elysia";
|
||||||
|
|
||||||
|
export async function misiPPIDDelete(context: Context) {
|
||||||
|
const id = context.params.id
|
||||||
|
|
||||||
|
await prisma.misiPPID.delete({
|
||||||
|
where: {
|
||||||
|
id: id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
message: "Misi PPID Berhasil Dihapus",
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
|
||||||
|
export async function misiPPIDFindMany() {
|
||||||
|
const res = await prisma.misiPPID.findMany();
|
||||||
|
return {
|
||||||
|
data: res,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import Elysia, { t } from "elysia";
|
||||||
|
import { misiPPIDFindMany } from "./find-many";
|
||||||
|
import misiPPIDCreate from "./create";
|
||||||
|
import { misiPPIDDelete } from "./delete";
|
||||||
|
import misiPPIDUpdate from "./update";
|
||||||
|
|
||||||
|
const MisiPPID = new Elysia({
|
||||||
|
prefix: "/misippid",
|
||||||
|
tags: ["PPID/Visi Misi PPID/ Misi PPID"],
|
||||||
|
})
|
||||||
|
.get("/find-many", misiPPIDFindMany)
|
||||||
|
.post("/create", misiPPIDCreate, {
|
||||||
|
body: t.Object({
|
||||||
|
content: t.String(),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.put("/update/:id", misiPPIDUpdate, {
|
||||||
|
body: t.Object({
|
||||||
|
content: t.String(),
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.delete("/delete/:id", misiPPIDDelete)
|
||||||
|
|
||||||
|
export default MisiPPID;
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import prisma from "@/lib/prisma";
|
||||||
|
import { Prisma } from "@prisma/client";
|
||||||
|
import { Context } from "elysia";
|
||||||
|
|
||||||
|
type FormUpdate = Prisma.MisiPPIDGetPayload<{
|
||||||
|
select: {
|
||||||
|
content: true;
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
|
||||||
|
export default async function misiPPIDUpdate(context: Context) {
|
||||||
|
const id = context.params.id
|
||||||
|
const body = context.body as FormUpdate;
|
||||||
|
|
||||||
|
await prisma.misiPPID.update({
|
||||||
|
where: { id: id },
|
||||||
|
data: {
|
||||||
|
content: body.content,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
message: "Misi PPID Berhasil Diupdate",
|
||||||
|
data: {
|
||||||
|
...body,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import { AppServer } from '@/app/api/[[...slugs]]/route'
|
import { AppServer } from '@/app/api/[[...slugs]]/route'
|
||||||
import { treaty } from '@elysiajs/eden'
|
import { treaty } from '@elysiajs/eden'
|
||||||
const ApiFetch = treaty<AppServer>(process.env.NEXT_PUBLIC_WIBU_URL || 'localhost:3000')
|
|
||||||
|
const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL || 'localhost:3000'
|
||||||
|
const ApiFetch = treaty<AppServer>(BASE_URL)
|
||||||
|
|
||||||
export default ApiFetch
|
export default ApiFetch
|
||||||
Reference in New Issue
Block a user