- Juri LKBB Antareja 2024
+ Juri LPKBB Antareja 2024
- Yuk kenalan dulu dengan tim juri LKBB Antareja tahun 2024
+ Yuk kenalan dulu dengan tim juri LPKBB Antareja tahun 2024
diff --git a/src/app/(main)/components/Kategori.tsx b/src/app/(main)/components/Kategori.tsx
index e89e044..b766917 100644
--- a/src/app/(main)/components/Kategori.tsx
+++ b/src/app/(main)/components/Kategori.tsx
@@ -30,7 +30,7 @@ export default function Kategori() {
Date: Mon, 9 Sep 2024 00:29:54 +0700
Subject: [PATCH 6/9] feat(frontend) : add update verified user at admin
dashboard
---
src/actions/User.ts | 2 ++
.../admin/user/[id]/components/Form.tsx | 34 +++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/src/actions/User.ts b/src/actions/User.ts
index 8b36067..c61bdc5 100644
--- a/src/actions/User.ts
+++ b/src/actions/User.ts
@@ -33,6 +33,7 @@ export async function updateUserForm(data: FormData, id: string) {
const email = data.get("email") as string;
const password = (data.get("password") as string) || undefined;
const role = data.get("role") as Role;
+ const verified = data.get("verified") === "true";
try {
if (password) {
@@ -55,6 +56,7 @@ export async function updateUserForm(data: FormData, id: string) {
nama: name,
email: email,
role: role,
+ verified : verified,
}
);
revalidatePath("/", "layout");
diff --git a/src/app/(admin)/admin/user/[id]/components/Form.tsx b/src/app/(admin)/admin/user/[id]/components/Form.tsx
index 31116b1..25c7396 100644
--- a/src/app/(admin)/admin/user/[id]/components/Form.tsx
+++ b/src/app/(admin)/admin/user/[id]/components/Form.tsx
@@ -22,6 +22,11 @@ export default function UserForm({
{ label: "ADMIN", value: "ADMIN" },
];
+ const optionsVerified = [
+ { label: "true", value: "true" },
+ { label: "false", value: "false" },
+ ];
+
async function Create(data: FormData) {
const toastId = toast.loading("Loading...");
const result = await createUserForm(data);
@@ -102,6 +107,35 @@ export default function UserForm({
}}
/>
+
+
+
From 53b110a25ad5dc4841a0b2b654b9d8c97d705dc3 Mon Sep 17 00:00:00 2001
From: BaniHillabi
Date: Mon, 9 Sep 2024 11:57:10 +0700
Subject: [PATCH 7/9] feat (backend) : add update pembayaran query
---
src/queries/pembayaran.query.ts | 36 +++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 src/queries/pembayaran.query.ts
diff --git a/src/queries/pembayaran.query.ts b/src/queries/pembayaran.query.ts
new file mode 100644
index 0000000..0873956
--- /dev/null
+++ b/src/queries/pembayaran.query.ts
@@ -0,0 +1,36 @@
+import prisma from "@/lib/prisma";
+import { Prisma } from "@prisma/client";
+
+export async function createTim(data: Prisma.TimCreateInput) {
+ const createdTim = await prisma.tim.create({ data });
+ return createdTim;
+}
+
+export async function findTims(where?: Prisma.TimWhereInput) {
+ const tims = await prisma.tim.findMany({
+ include: { anggotas: true, pembayaran: true },
+ where,
+ });
+ return tims;
+}
+
+export async function findTim(
+ where: Prisma.TimWhereUniqueInput,
+ include?: Prisma.TimInclude
+) {
+ const tim = await prisma.tim.findUnique({ where, include });
+ return tim;
+}
+
+export async function updatePembayaran(
+ where: Prisma.PembayaranWhereUniqueInput,
+ data: Prisma.PembayaranUncheckedUpdateInput
+) {
+ const updatedPembayaran = prisma.pembayaran.update({ where, data });
+ return updatedPembayaran;
+}
+
+export async function deleteTim(where: Prisma.TimWhereUniqueInput) {
+ const deletedTim = await prisma.tim.delete({ where });
+ return deletedTim;
+}
From 6b4b4428dc14d0b3c52422ec755e6074db49e688 Mon Sep 17 00:00:00 2001
From: BaniHillabi
Date: Mon, 9 Sep 2024 12:02:06 +0700
Subject: [PATCH 8/9] feat (frontend) : add update DP
---
src/actions/pembayaran.ts | 6 ++--
.../admin/pembayaran/[id]/components/Form.tsx | 35 +++++++++++++++++++
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/src/actions/pembayaran.ts b/src/actions/pembayaran.ts
index 6833fc9..fea71fa 100644
--- a/src/actions/pembayaran.ts
+++ b/src/actions/pembayaran.ts
@@ -1,5 +1,6 @@
"use server";
+import { updatePembayaran } from "@/queries/pembayaran.query";
import { updateTim } from "@/queries/tim.query";
import { revalidatePath } from "next/cache";
@@ -7,11 +8,12 @@ export default async function konfirmasiPembayaran(
data: FormData,
idTim: string
) {
- const status = Boolean(data.get("confirm") as string);
+ const status = data.get("confirm") === "true";
+ const statusPembayaran = data.get("isDP") === "true";
- console.log(status);
try {
await updateTim({ id: idTim }, { confirmed: status });
+ await updatePembayaran({ tim_id: idTim }, { isDP: statusPembayaran });
revalidatePath("/", "layout");
return { success: true, message: "Berhasil mengupdate status pembayaran!" };
} catch (e) {
diff --git a/src/app/(admin)/admin/pembayaran/[id]/components/Form.tsx b/src/app/(admin)/admin/pembayaran/[id]/components/Form.tsx
index 8335396..0c4ca73 100644
--- a/src/app/(admin)/admin/pembayaran/[id]/components/Form.tsx
+++ b/src/app/(admin)/admin/pembayaran/[id]/components/Form.tsx
@@ -21,6 +21,11 @@ export default function PembayaranForm({
{ label: "Belum Terkonfirmasi", value: false },
];
+ const optionsPembayaran = [
+ { label: "Lunas", value: "false" },
+ { label: "DP 50%", value: "true" },
+ ];
+
async function Update(dataForm: FormData) {
const toastId = toast.loading("Loading...");
const result = await konfirmasiPembayaran(dataForm, data?.id!);
@@ -94,6 +99,36 @@ export default function PembayaranForm({
}}
/>
+
+
+
+
From e907dafe55090aeb2de7bd254f2e9606f0d61f00 Mon Sep 17 00:00:00 2001
From: teguhbayupratama
Date: Mon, 9 Sep 2024 15:54:37 +0800
Subject: [PATCH 9/9] fix: Add deployment migrate to CD pipeline
---
.github/workflows/CD.yml | 4 ++--
package.json | 1 +
src/app/(main)/dashboard/anggota/[posisi]/page.tsx | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml
index 4dec205..21cf153 100644
--- a/.github/workflows/CD.yml
+++ b/.github/workflows/CD.yml
@@ -34,8 +34,8 @@ jobs:
echo 'GOOGLE_REDIRECT_URI=${{secrets.GOOGLE_REDIRECT_URI}}' >> /home/mokletdev/actions-runner/_work/antareja/antareja/.env.local
- name: Install Modules
run: npm ci
- - name: Generate prisma
- run: npm run prisma:generate
+ - name: Push prisma schema
+ run: npm run prisma:deploy
- name: Build site
run: npm run build --if-present
- name: change dir
diff --git a/package.json b/package.json
index 817f066..4e01c44 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,7 @@
"prettier": "prettier --write .",
"prisma": "dotenv -e .env.local prisma migrate dev",
"prisma:generate": "dotenv -e .env.local prisma generate",
+ "prisma:deploy": "dotenv -e .env.local prisma migrate deploy",
"prisma:push": "dotenv -e .env.local prisma db push",
"prisma:studio": "dotenv -e .env.local prisma studio"
},
diff --git a/src/app/(main)/dashboard/anggota/[posisi]/page.tsx b/src/app/(main)/dashboard/anggota/[posisi]/page.tsx
index 997074c..79fa45c 100644
--- a/src/app/(main)/dashboard/anggota/[posisi]/page.tsx
+++ b/src/app/(main)/dashboard/anggota/[posisi]/page.tsx
@@ -32,6 +32,7 @@ export default async function EditAnggota({
timId: "",
} as unknown as Anggota);
+ console.log(anggota)
return (