# feat
## Deskripsi : - Notifikasi donasi ### No Issue
This commit is contained in:
BIN
public/donasi/pencairan/ba62da22-8973-4789-88a3-b20acd726dc9.jpg
Normal file
BIN
public/donasi/pencairan/ba62da22-8973-4789-88a3-b20acd726dc9.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
BIN
public/profile/foto/02fd0df2-337e-474f-972f-cd3748ac19a7.jpg
Normal file
BIN
public/profile/foto/02fd0df2-337e-474f-972f-cd3748ac19a7.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
public/profile/foto/f29acfca-8c7d-4613-9c4c-51eba880a979.jpg
Normal file
BIN
public/profile/foto/f29acfca-8c7d-4613-9c4c-51eba880a979.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
11
src/app/dev/donasi/bukti-transfer/[id]/page.tsx
Normal file
11
src/app/dev/donasi/bukti-transfer/[id]/page.tsx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { LayoutDonasi_BuktiTransfer } from "@/app_modules/donasi";
|
||||||
|
|
||||||
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
let imageId = params.id;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<LayoutDonasi_BuktiTransfer imageId={imageId} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -88,7 +88,7 @@ export default function AdminDonasi_DetailPublish({
|
|||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(pencairan, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(pencairan, null, 2)}</pre> */}
|
||||||
<Stack>
|
<Stack>
|
||||||
<ComponentAdminGlobal_BackButton />
|
<ComponentAdminGlobal_BackButton path={RouterAdminDonasi.table_publish} />
|
||||||
<TampilanDetailDonasi donasi={dataDonasi} countDonatur={countDonatur} />
|
<TampilanDetailDonasi donasi={dataDonasi} countDonatur={countDonatur} />
|
||||||
<TampilanListDonatur
|
<TampilanListDonatur
|
||||||
donatur={listDonatur}
|
donatur={listDonatur}
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal";
|
||||||
|
import { ComponentAdminGlobal_NotifikasiPeringatan } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_peringatan";
|
||||||
import ComponentAdminGlobal_TampilanRupiahDonasi from "@/app_modules/admin/component_global/tampilan_rupiah";
|
import ComponentAdminGlobal_TampilanRupiahDonasi from "@/app_modules/admin/component_global/tampilan_rupiah";
|
||||||
|
import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user";
|
||||||
import ComponentDonasi_NotedBox from "@/app_modules/donasi/component/noted_box";
|
import ComponentDonasi_NotedBox from "@/app_modules/donasi/component/noted_box";
|
||||||
import { NotifBerhasil } from "@/app_modules/donasi/component/notifikasi/notif_berhasil";
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
import { NotifGagal } from "@/app_modules/donasi/component/notifikasi/notif_gagal";
|
|
||||||
import { NotifPeringatan } from "@/app_modules/donasi/component/notifikasi/notif_peringatan";
|
|
||||||
import {
|
import {
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Button,
|
Button,
|
||||||
@@ -25,12 +28,8 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentAdminDonasi_TombolKembali from "../../component/tombol_kembali";
|
import ComponentAdminDonasi_TombolKembali from "../../component/tombol_kembali";
|
||||||
import { AdminDonasi_funCreatePencairanDana } from "../../fun/create/fun_create_pencairan_dana";
|
import { AdminDonasi_funCreatePencairanDana } from "../../fun/create/fun_create_pencairan_dana";
|
||||||
import { AdminDonasi_AkumulasiPencairanById } from "../../fun/update/fun_update_akumulasi_pencairan";
|
|
||||||
import ComponentGlobal_ErrorInput from "@/app_modules/_global/component/error_input";
|
|
||||||
import { ComponentAdminGlobal_NotifikasiPeringatan } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_peringatan";
|
|
||||||
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil";
|
|
||||||
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal";
|
|
||||||
import { AdminDonasi_getOneById } from "../../fun/get/get_one_by_id";
|
import { AdminDonasi_getOneById } from "../../fun/get/get_one_by_id";
|
||||||
|
import { AdminDonasi_AkumulasiPencairanById } from "../../fun/update/fun_update_akumulasi_pencairan";
|
||||||
|
|
||||||
export default function AdminDonasi_PencairanDana({
|
export default function AdminDonasi_PencairanDana({
|
||||||
donasiId,
|
donasiId,
|
||||||
@@ -56,7 +55,7 @@ export default function AdminDonasi_PencairanDana({
|
|||||||
onSuccess={(val) => {
|
onSuccess={(val) => {
|
||||||
setTerkumpul(val.terkumpul);
|
setTerkumpul(val.terkumpul);
|
||||||
setTotal(val.totalPencairan);
|
setTotal(val.totalPencairan);
|
||||||
console.log(val)
|
console.log(val);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -148,15 +147,6 @@ function FormView({
|
|||||||
}
|
}
|
||||||
value={value.nilai}
|
value={value.nilai}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
// const nilai = val.currentTarget.value;
|
|
||||||
// const nilaiTypeNumber = toNumber(val.currentTarget.value);
|
|
||||||
|
|
||||||
// if (nilaiTypeNumber > sisaDana) {
|
|
||||||
// console.log("lebih");
|
|
||||||
// } else {
|
|
||||||
// console.log("kurang");
|
|
||||||
// }
|
|
||||||
|
|
||||||
const match = val.currentTarget.value
|
const match = val.currentTarget.value
|
||||||
.replace(/\./g, "")
|
.replace(/\./g, "")
|
||||||
.match(/^[0-9]+$/);
|
.match(/^[0-9]+$/);
|
||||||
@@ -314,24 +304,41 @@ async function onSave({
|
|||||||
const gambar = new FormData();
|
const gambar = new FormData();
|
||||||
gambar.append("file", file as any);
|
gambar.append("file", file as any);
|
||||||
|
|
||||||
await AdminDonasi_funCreatePencairanDana(body as any, gambar).then(
|
const res = await AdminDonasi_funCreatePencairanDana(body as any, gambar);
|
||||||
async (res) => {
|
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
await AdminDonasi_AkumulasiPencairanById(
|
const res2 = await AdminDonasi_AkumulasiPencairanById(
|
||||||
body.donasiId as any,
|
body.donasiId as any,
|
||||||
body.nominalCair as any
|
body.nominalCair as any
|
||||||
).then(async (res) => {
|
);
|
||||||
if (res.status === 200) {
|
if (res2.status === 200) {
|
||||||
const loadData = await AdminDonasi_getOneById(donasiId);
|
const loadData = await AdminDonasi_getOneById(donasiId);
|
||||||
onSuccess1(loadData);
|
onSuccess1(loadData);
|
||||||
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
|
||||||
|
const dataNotif = {
|
||||||
|
appId: loadData?.id,
|
||||||
|
userId: loadData?.authorId,
|
||||||
|
pesan: loadData?.title as any,
|
||||||
|
status: "Pencairan Dana",
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
title: "Dana donasi berhasil dicairkan",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await adminNotifikasi_funCreateToUser({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({ userId: loadData?.authorId, count: 1 })
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ComponentAdminGlobal_NotifikasiBerhasil(res2.message);
|
||||||
|
} else {
|
||||||
|
ComponentAdminGlobal_NotifikasiGagal(res2.message);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
} else {
|
|
||||||
NotifGagal(res.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,14 +60,15 @@ export default function MainCrowd() {
|
|||||||
border: `2px solid ${AccentColor.blue}`,
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
borderRadius: "10px",
|
borderRadius: "10px",
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
color: "white",
|
// color: "white",
|
||||||
|
color: "gray",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// setLoadingInv(true);
|
// setLoadingInv(true);
|
||||||
// router.push(RouterCrowd.investasi);
|
// router.push(RouterCrowd.investasi);
|
||||||
// setChangeColor(0);
|
// setChangeColor(0);
|
||||||
ComponentGlobal_NotifikasiPeringatan(
|
ComponentGlobal_NotifikasiPeringatan(
|
||||||
"Sementara ini sedang maintenance",
|
"Sedang Perbaikan",
|
||||||
3000
|
3000
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
@@ -103,13 +104,13 @@ export default function MainCrowd() {
|
|||||||
color: "white",
|
color: "white",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// setLoadingDon(true);
|
setLoadingDon(true);
|
||||||
// router.push(RouterCrowd.donasi);
|
router.push(RouterCrowd.donasi);
|
||||||
// setDonasiHotMenu(0);
|
setDonasiHotMenu(0);
|
||||||
ComponentGlobal_NotifikasiPeringatan(
|
// ComponentGlobal_NotifikasiPeringatan(
|
||||||
"Sementara ini sedang maintenance",
|
// "Sementara ini sedang maintenance",
|
||||||
3000
|
// 3000
|
||||||
);
|
// );
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|||||||
@@ -69,18 +69,7 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
radius={"sm"}
|
radius={"sm"}
|
||||||
/>
|
/>
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
{/* <Center>
|
|
||||||
<Image
|
|
||||||
maw={200}
|
|
||||||
radius={"xs"}
|
|
||||||
alt="Foto"
|
|
||||||
src={RouterDonasi?.api_gambar + `${donasi?.imagesId}`}
|
|
||||||
/>
|
|
||||||
</Center> */}
|
|
||||||
{/* <AspectRatio ratio={16 / 9}>
|
|
||||||
<Paper radius={"md"}>
|
|
||||||
</Paper>
|
|
||||||
</AspectRatio> */}
|
|
||||||
<Stack spacing={0} mt={"lg"}>
|
<Stack spacing={0} mt={"lg"}>
|
||||||
<Title order={4}>{donasi?.title}</Title>
|
<Title order={4}>{donasi?.title}</Title>
|
||||||
<ComponentDonasi_TampilanHitungMundur
|
<ComponentDonasi_TampilanHitungMundur
|
||||||
@@ -172,8 +161,12 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
<Grid.Col
|
<Grid.Col
|
||||||
span={"auto"}
|
span={"auto"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoadingPencairan(true);
|
onPencairanDana(
|
||||||
onPencairanDana(router, donasi, userLoginId);
|
router,
|
||||||
|
donasi,
|
||||||
|
userLoginId,
|
||||||
|
setLoadingPencairan
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack spacing={"sm"} align="center">
|
<Stack spacing={"sm"} align="center">
|
||||||
@@ -199,19 +192,19 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
async function onPencairanDana(
|
async function onPencairanDana(
|
||||||
router: AppRouterInstance,
|
router: AppRouterInstance,
|
||||||
donasi: MODEL_DONASI,
|
donasi: MODEL_DONASI,
|
||||||
userLoginId: string
|
userLoginId: string,
|
||||||
|
setLoadingPencairan: any
|
||||||
) {
|
) {
|
||||||
// console.log(userLoginId)
|
|
||||||
// console.log(donasi.authorId)
|
|
||||||
const cek = await Donasi_findDonaturByTokenId(donasi.id, userLoginId);
|
const cek = await Donasi_findDonaturByTokenId(donasi.id, userLoginId);
|
||||||
|
if (userLoginId == donasi.authorId) {
|
||||||
if (userLoginId == donasi.authorId)
|
setLoadingPencairan(true);
|
||||||
return router.push(RouterDonasi.pencairan_dana + `${donasi.id}`);
|
return router.push(RouterDonasi.pencairan_dana + `${donasi.id}`);
|
||||||
|
}
|
||||||
if (!cek) return NotifPeringatan("Halaman khusus donatur");
|
|
||||||
router.push(RouterDonasi.pencairan_dana + `${donasi.id}`);
|
if (!cek) {
|
||||||
|
return NotifPeringatan("Halaman khusus donatur");
|
||||||
// if (userLoginId != donasi.authorId)
|
} else {
|
||||||
// return NotifPeringatan("Halaman khusus donatur");
|
setLoadingPencairan(true);
|
||||||
// router.push(RouterDonasi.pencairan_dana + `${donasi.id}`);
|
router.push(RouterDonasi.pencairan_dana + `${donasi.id}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import {
|
|||||||
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
||||||
|
import { notifikasiToUser_CreateKabarDonasi } from "@/app_modules/notifikasi/fun/create/create_notif_to_user_kabar_donasi";
|
||||||
|
|
||||||
export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -74,6 +75,7 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
|||||||
label="Deskripsi"
|
label="Deskripsi"
|
||||||
withAsterisk
|
withAsterisk
|
||||||
placeholder="Masukan deskripsi kabar"
|
placeholder="Masukan deskripsi kabar"
|
||||||
|
autosize
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setKabar({
|
setKabar({
|
||||||
...kabar,
|
...kabar,
|
||||||
@@ -188,7 +190,13 @@ async function onSave(
|
|||||||
|
|
||||||
const res = await Donasi_funCreateKabar(body as any, gambar);
|
const res = await Donasi_funCreateKabar(body as any, gambar);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
// Notif ke setiap donatur
|
await notifikasiToUser_CreateKabarDonasi({
|
||||||
|
donasiId: donasiId,
|
||||||
|
kabarId: res.kabarId as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
router.back();
|
||||||
} else {
|
} else {
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
48
src/app_modules/donasi/detail/detail_main/bukti_transfer.tsx
Normal file
48
src/app_modules/donasi/detail/detail_main/bukti_transfer.tsx
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
|
import { AspectRatio, Box, Image, Paper } from "@mantine/core";
|
||||||
|
|
||||||
|
export function LayoutDonasi_BuktiTransfer({ imageId }: { imageId: string }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<UIGlobal_LayoutTamplate
|
||||||
|
header={<UIGlobal_LayoutHeaderTamplate title="Bukti Transfer" />}
|
||||||
|
>
|
||||||
|
<ViewBuktiTransfer imageId={imageId} />
|
||||||
|
</UIGlobal_LayoutTamplate>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ViewBuktiTransfer({ imageId }: { imageId: string }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
padding: "15px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<AspectRatio ratio={1 / 1} mah={400}>
|
||||||
|
<Box>
|
||||||
|
<Image
|
||||||
|
p={"md"}
|
||||||
|
width={250}
|
||||||
|
alt="Foto"
|
||||||
|
src={RouterDonasi.api_gambar_pencairan + `${imageId}`}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
</AspectRatio>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import {
|
import { Stack } from "@mantine/core";
|
||||||
Stack
|
|
||||||
} from "@mantine/core";
|
|
||||||
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
||||||
import { ComponentDonasi_DetailDataMain } from "../../component/detail_main/detail_data_donasi";
|
import { ComponentDonasi_DetailDataMain } from "../../component/detail_main/detail_data_donasi";
|
||||||
import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main/informasi_penggalang";
|
import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main/informasi_penggalang";
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import ComponentDonasi_NotedBox from "@/app_modules/donasi/component/noted_box";
|
import ComponentDonasi_NotedBox from "@/app_modules/donasi/component/noted_box";
|
||||||
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
||||||
import {
|
import {
|
||||||
@@ -23,8 +29,10 @@ import {
|
|||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useDisclosure } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
import { IconTransferIn } from "@tabler/icons-react";
|
import { IconImageInPicture, IconTransferIn } from "@tabler/icons-react";
|
||||||
|
import _ from "lodash";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function PencairanDanaDonasi({
|
export default function PencairanDanaDonasi({
|
||||||
@@ -49,7 +57,17 @@ export default function PencairanDanaDonasi({
|
|||||||
function BoxDanaDicarikan({ akumulasi }: { akumulasi: MODEL_DONASI }) {
|
function BoxDanaDicarikan({ akumulasi }: { akumulasi: MODEL_DONASI }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Paper bg={"gray.1"} p={"md"}>
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "10px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
@@ -63,7 +81,7 @@ function BoxDanaDicarikan({ akumulasi }: { akumulasi: MODEL_DONASI }) {
|
|||||||
<Text fz={"xs"}>Pencairan dana</Text>
|
<Text fz={"xs"}>Pencairan dana</Text>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ComponentDonasi_NotedBox
|
<ComponentGlobal_BoxInformation
|
||||||
informasi=" Pencairan dana akan dilakukan oleh Admin HIPMI tanpa campur tangan
|
informasi=" Pencairan dana akan dilakukan oleh Admin HIPMI tanpa campur tangan
|
||||||
pihak manapun, jika berita pencairan dana dibawah tidak sesuai
|
pihak manapun, jika berita pencairan dana dibawah tidak sesuai
|
||||||
dengan kabar yang diberikan oleh PENGGALANG DANA. Maka pegguna lain
|
dengan kabar yang diberikan oleh PENGGALANG DANA. Maka pegguna lain
|
||||||
@@ -80,6 +98,7 @@ function InformasiPencairanDana({
|
|||||||
}: {
|
}: {
|
||||||
listPD: MODEL_DONASI_PENCAIRAN_DANA[];
|
listPD: MODEL_DONASI_PENCAIRAN_DANA[];
|
||||||
}) {
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
const [opened, { open, close }] = useDisclosure(false);
|
const [opened, { open, close }] = useDisclosure(false);
|
||||||
const [idGambar, setIdGambar] = useState("");
|
const [idGambar, setIdGambar] = useState("");
|
||||||
return (
|
return (
|
||||||
@@ -94,8 +113,21 @@ function InformasiPencairanDana({
|
|||||||
</Paper>
|
</Paper>
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
</Modal>
|
</Modal>
|
||||||
{listPD.map((e, i) => (
|
|
||||||
<Paper key={i} withBorder p={"md"}>
|
{_.isEmpty(listPD) ? (
|
||||||
|
<ComponentGlobal_IsEmptyData height={20} />
|
||||||
|
) : (
|
||||||
|
listPD.map((e, i) => (
|
||||||
|
<Paper
|
||||||
|
key={i}
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Text fz={"xs"}>{moment(e.createdAt).format("ll")}</Text>
|
<Text fz={"xs"}>{moment(e.createdAt).format("ll")}</Text>
|
||||||
<Stack spacing={"lg"}>
|
<Stack spacing={"lg"}>
|
||||||
<Title order={5}>{e.title}</Title>
|
<Title order={5}>{e.title}</Title>
|
||||||
@@ -109,19 +141,25 @@ function InformasiPencairanDana({
|
|||||||
<Center>
|
<Center>
|
||||||
<Button
|
<Button
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
variant="outline"
|
leftIcon={<IconImageInPicture />}
|
||||||
leftIcon={<IconTransferIn />}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
open();
|
// open();
|
||||||
setIdGambar(e.imagesId);
|
// setIdGambar(e.imagesId);
|
||||||
|
router.push(`/dev/donasi/bukti-transfer/${e.imagesId}`, {
|
||||||
|
scroll: false,
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Bukti Transfer
|
Bukti Transfer
|
||||||
</Button>
|
</Button>
|
||||||
</Center>
|
</Center>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
))}
|
))
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import ComponentDonasi_HeaderTamplate from "@/app_modules/donasi/component/header_tamplate";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import { AppShell } from "@mantine/core";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function LayoutPencairanDanaDonasi({
|
export default function LayoutPencairanDanaDonasi({
|
||||||
@@ -12,11 +11,11 @@ export default function LayoutPencairanDanaDonasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Pencairan Dana" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Pencairan Dana" />}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
|
import { AccentColor, MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import ComponentDonasi_CardPublish from "@/app_modules/donasi/component/card_view/box_publish";
|
import ComponentDonasi_CardPublish from "@/app_modules/donasi/component/card_view/box_publish";
|
||||||
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
||||||
import {
|
import {
|
||||||
@@ -61,12 +62,20 @@ function InformasiPenggalang({ value }: { value: MODEL_USER }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(value, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(value, null, 2)}</pre> */}
|
||||||
<Paper radius={"md"}>
|
<Box
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
padding: "20px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "10px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack
|
<Stack
|
||||||
bg={"gray.1"}
|
|
||||||
p={"md"}
|
|
||||||
spacing={"xl"}
|
spacing={"xl"}
|
||||||
sx={{ borderRadius: "10px" }}
|
|
||||||
>
|
>
|
||||||
<Stack align="center" spacing={0}>
|
<Stack align="center" spacing={0}>
|
||||||
<Paper
|
<Paper
|
||||||
@@ -87,16 +96,16 @@ function InformasiPenggalang({ value }: { value: MODEL_USER }) {
|
|||||||
/>
|
/>
|
||||||
</Center>
|
</Center>
|
||||||
</Paper>
|
</Paper>
|
||||||
<Title order={3}>@{value.username}</Title>
|
<Title order={3}>@{value?.username}</Title>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Group>
|
<Group>
|
||||||
<IconMoodSmile />
|
<IconMoodSmile />
|
||||||
<Text>Nama Penggalang Dana</Text>
|
<Text>{value?.Profile.name}</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<IconPhone />
|
<IconPhone />
|
||||||
<Text>+{value.nomor}</Text>
|
<Text>+{value?.nomor}</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<IconBrandGmail />
|
<IconBrandGmail />
|
||||||
@@ -104,7 +113,7 @@ function InformasiPenggalang({ value }: { value: MODEL_USER }) {
|
|||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Box>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,13 +35,19 @@ export default function ListKabarDonasi({
|
|||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [kabar, setKabar] = useState(listKabar);
|
const [kabar, setKabar] = useState(listKabar);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Button
|
<Button
|
||||||
|
loaderPosition="center"
|
||||||
|
loading={isLoading ? true : false}
|
||||||
leftIcon={<IconCirclePlus />}
|
leftIcon={<IconCirclePlus />}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => router.push(RouterDonasi.create_kabar + `${donasiId}`)}
|
onClick={() => {
|
||||||
|
setIsLoading(true);
|
||||||
|
router.push(RouterDonasi.create_kabar + `${donasiId}`);
|
||||||
|
}}
|
||||||
bg={MainColor.yellow}
|
bg={MainColor.yellow}
|
||||||
color="yellow"
|
color="yellow"
|
||||||
c={"black"}
|
c={"black"}
|
||||||
|
|||||||
@@ -40,22 +40,14 @@ export async function Donasi_funCreateKabar(
|
|||||||
donasiId: req.donasiId,
|
donasiId: req.donasiId,
|
||||||
imagesId: upload.id,
|
imagesId: upload.id,
|
||||||
},
|
},
|
||||||
select: {
|
|
||||||
Donasi: {
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
title: true,
|
|
||||||
authorId: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!createWithPhoto) return { status: 400, message: "Gagal membuat data" };
|
if (!createWithPhoto) return { status: 400, message: "Gagal membuat data" };
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Berhasil disimpan",
|
message: "Berhasil disimpan",
|
||||||
data: createWithPhoto,
|
kabarId: createWithPhoto.id,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,21 +57,12 @@ export async function Donasi_funCreateKabar(
|
|||||||
deskripsi: req.deskripsi,
|
deskripsi: req.deskripsi,
|
||||||
donasiId: req.donasiId,
|
donasiId: req.donasiId,
|
||||||
},
|
},
|
||||||
select: {
|
|
||||||
Donasi: {
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
title: true,
|
|
||||||
authorId: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
revalidatePath("/dev/donasi/list_kabar");
|
revalidatePath("/dev/donasi/list_kabar");
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Berhasil disimpan",
|
message: "Berhasil disimpan",
|
||||||
data: create,
|
kabarId: create.id,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ import Donasi_DetailNotif from "./detail/deail_notif";
|
|||||||
import LayoutDonasi_DetailNotif from "./detail/deail_notif/layout";
|
import LayoutDonasi_DetailNotif from "./detail/deail_notif/layout";
|
||||||
import Donasi_EditRekening from "./edit/edit_rekening";
|
import Donasi_EditRekening from "./edit/edit_rekening";
|
||||||
import LayoutDonasi_EditRekening from "./edit/edit_rekening/layout";
|
import LayoutDonasi_EditRekening from "./edit/edit_rekening/layout";
|
||||||
|
export { LayoutDonasi_BuktiTransfer } from "./detail/detail_main/bukti_transfer";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
MainDonasi,
|
MainDonasi,
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ export function Home_UiView({
|
|||||||
<Stack h={"100%"} align="center" justify="flex-start">
|
<Stack h={"100%"} align="center" justify="flex-start">
|
||||||
<IconUserSearch size={20} color="white" />
|
<IconUserSearch size={20} color="white" />
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack spacing={0} bg={"cyan"} w={"70%"}>
|
<Stack spacing={0} w={"60%"}>
|
||||||
<Text
|
<Text
|
||||||
lineClamp={1}
|
lineClamp={1}
|
||||||
fz={"sm"}
|
fz={"sm"}
|
||||||
|
|||||||
@@ -46,4 +46,14 @@ export function redirectDonasiPage({
|
|||||||
});
|
});
|
||||||
router.push(pathDetail, { scroll: false });
|
router.push(pathDetail, { scroll: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.status === "Kabar Donasi") {
|
||||||
|
const pathKabar = RouterDonasi.detail_kabar + data.appId;
|
||||||
|
router.push(pathKabar, { scroll: false });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.status === "Pencairan Dana") {
|
||||||
|
const pathPencairan = RouterDonasi.pencairan_dana + data.appId;
|
||||||
|
router.push(pathPencairan, { scroll: false });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,58 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import _ from "lodash";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
|
||||||
export async function notifikasiToUser_CreateKabarDonasi({
|
export async function notifikasiToUser_CreateKabarDonasi({
|
||||||
donasiId,
|
donasiId,
|
||||||
|
kabarId,
|
||||||
}: {
|
}: {
|
||||||
donasiId: string;
|
donasiId: string;
|
||||||
|
kabarId: string;
|
||||||
}) {
|
}) {
|
||||||
|
const getDataDonasi = await prisma.donasi.findFirst({
|
||||||
|
where: {
|
||||||
|
id: donasiId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const getDonatur = await prisma.donasi_Invoice.findMany({
|
const getDonatur = await prisma.donasi_Invoice.findMany({
|
||||||
where: {
|
where: {
|
||||||
donasiId: donasiId,
|
donasiId: donasiId,
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
Donasi: {
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
authorId: true,
|
authorId: true,
|
||||||
title: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(getDonatur)
|
const data = new Set(getDonatur.map((e) => e.authorId));
|
||||||
|
const dataFix = Array.from(data);
|
||||||
|
|
||||||
|
for (let authorId of dataFix) {
|
||||||
|
console.log(authorId);
|
||||||
|
const createNotifikasi = await prisma.notifikasi.create({
|
||||||
|
data: {
|
||||||
|
userRoleId: "1",
|
||||||
|
userId: authorId,
|
||||||
|
appId: kabarId,
|
||||||
|
pesan: getDataDonasi?.title as any,
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
status: "Kabar Donasi",
|
||||||
|
title: "Kabar terupdate donasi anda !",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!createNotifikasi)
|
||||||
|
return { status: 400, message: "Gagal membuat notifikasi" };
|
||||||
|
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({
|
||||||
|
userId: authorId,
|
||||||
|
count: 1,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return { status: 201, message: "Berhasil membuat notifikasi" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ export interface MODEL_NOTIFIKASI {
|
|||||||
| "Proses"
|
| "Proses"
|
||||||
| "Berhasil"
|
| "Berhasil"
|
||||||
| "Gagal"
|
| "Gagal"
|
||||||
| "Donatur Baru";
|
| "Donatur Baru"
|
||||||
|
| "Kabar Donasi"
|
||||||
|
| "Pencairan Dana"
|
||||||
|
|
||||||
Role: MODEL_NEW_DEFAULT_MASTER;
|
Role: MODEL_NEW_DEFAULT_MASTER;
|
||||||
userRoleId: String;
|
userRoleId: String;
|
||||||
|
|||||||
98
zCoba.js
98
zCoba.js
@@ -1,75 +1,25 @@
|
|||||||
const moment = require("moment");
|
const data = [
|
||||||
var fs = require("fs");
|
{
|
||||||
const _ = require("lodash");
|
authorId: "clx8pl7r90005su4mldioo0v1",
|
||||||
|
Donasi: {
|
||||||
|
id: "clyr304q0000410ljvzms3mag",
|
||||||
|
title: "Donasi Bencana Alam Aceh",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
authorId: "clx8pl7r90005su4mldioo0v1",
|
||||||
|
Donasi: {
|
||||||
|
id: "clyr304q0000410ljvzms3mag",
|
||||||
|
title: "Donasi Bencana Alam Aceh",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
authorId: "clycka5eu0001ina3i1ssgze9",
|
||||||
|
Donasi: {
|
||||||
|
id: "clyr304q0000410ljvzms3mag",
|
||||||
|
title: "Donasi Bencana Alam Aceh",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
// function Coba() {
|
console.log(new Set(data.map((d) => d.authorId)));
|
||||||
// let total = 100;
|
|
||||||
// let sisa = 1;
|
|
||||||
|
|
||||||
// const hasil = (total - sisa)
|
|
||||||
// console.log(hasil)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Coba();
|
|
||||||
|
|
||||||
// function Coba1() {
|
|
||||||
// const fruits = [];
|
|
||||||
// const data = 10 - 4
|
|
||||||
// fruits.push(data);
|
|
||||||
// console.log(fruits);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Coba1();
|
|
||||||
|
|
||||||
// include node fs module
|
|
||||||
|
|
||||||
// delete file named 'sample.txt' Synchronously
|
|
||||||
// fs.unlinkSync('coba.sh');
|
|
||||||
// console.log('File deleted!');
|
|
||||||
|
|
||||||
// function CobaProgress() {
|
|
||||||
// const t = 560000000;
|
|
||||||
// const b = 180000000
|
|
||||||
|
|
||||||
// const progress = (b / t) * 100;
|
|
||||||
// const pembulatan = Math.round(progress);
|
|
||||||
// console.log(progress, "progres");
|
|
||||||
// console.log(pembulatan, "pembulatan");
|
|
||||||
// // console.log(t/2)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// CobaProgress();
|
|
||||||
|
|
||||||
// function randomNumberPerSecond(){
|
|
||||||
// let lower = 0;
|
|
||||||
// let upper = 100;
|
|
||||||
|
|
||||||
// // Printing 5 random values
|
|
||||||
// // in range 2 and 11
|
|
||||||
// for (let i = 0; i < 1; i++) {
|
|
||||||
// setInterval(() => console.log("Hello" + " " + _.random(lower, upper)), 1000);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// randomNumberPerSecond()
|
|
||||||
|
|
||||||
// function CobaTanggal() {
|
|
||||||
// const tgl = "2024-01-25T12:00:24.008Z";
|
|
||||||
// const i = _.random(0, 100);
|
|
||||||
// // setInterval(() => console.log("hello" + i), 1000);
|
|
||||||
// const waktu = Date.now()
|
|
||||||
// const dt = moment(waktu).locale("fr").format()
|
|
||||||
// console.log(dt)
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// CobaTanggal();
|
|
||||||
|
|
||||||
function CobaSplice() {
|
|
||||||
let array = [1, 2, 3, 4, 5];
|
|
||||||
let indexToRemove = 1;
|
|
||||||
array.splice(indexToRemove, 1);
|
|
||||||
console.log(array);
|
|
||||||
}
|
|
||||||
|
|
||||||
CobaSplice();
|
|
||||||
|
|||||||
Reference in New Issue
Block a user