new feature
deskripsi: - fitur tambah sponsor
This commit is contained in:
@@ -962,14 +962,15 @@ model MasterKategoriApp {
|
|||||||
// ======================= EVENT ======================= //
|
// ======================= EVENT ======================= //
|
||||||
|
|
||||||
model EventSponsor {
|
model EventSponsor {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
isActive Boolean @default(true)
|
isActive Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
name String
|
name String
|
||||||
fileName String
|
isTransfer Boolean? @default(false)
|
||||||
fileExt String?
|
fileName String
|
||||||
fileId String
|
fileExt String?
|
||||||
|
fileId String
|
||||||
|
|
||||||
Author User? @relation(fields: [auhtorId], references: [id])
|
Author User? @relation(fields: [auhtorId], references: [id])
|
||||||
auhtorId String?
|
auhtorId String?
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { prisma } from "@/app/lib";
|
import { prisma } from "@/app/lib";
|
||||||
|
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
||||||
|
import { IEventSponsor } from "@/app_modules/event/_lib/interface";
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function POST(
|
export async function POST(
|
||||||
@@ -13,40 +15,39 @@ export async function POST(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { id } = context.params;
|
const userLoginId = await funGetUserIdByToken();
|
||||||
|
|
||||||
const body = await request.json();
|
if (!userLoginId) {
|
||||||
console.log("body", body);
|
return NextResponse.json(
|
||||||
console.log("id", id);
|
{ success: false, message: "User not found" },
|
||||||
|
{ status: 401 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// const res = await prisma.eventSponsor.create({
|
try {
|
||||||
|
let fixData;
|
||||||
|
const { id } = context.params;
|
||||||
|
const req: IEventSponsor = await request.json();
|
||||||
|
|
||||||
// })
|
fixData = await prisma.eventSponsor.create({
|
||||||
|
data: {
|
||||||
|
eventId: id,
|
||||||
|
name: req.name as string,
|
||||||
|
fileName: req.fileName as string,
|
||||||
|
fileExt: req.fileExt as string,
|
||||||
|
fileId: req.fileId as string,
|
||||||
|
auhtorId: userLoginId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
success: true,
|
success: true,
|
||||||
message: "Success create sponsor",
|
message: "Success create sponsor",
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
// try {
|
return NextResponse.json(
|
||||||
// const { id } = context.params;
|
{ success: false, message: "Failed create sponsor" },
|
||||||
|
{ status: 500 }
|
||||||
// const body = await request.json();
|
);
|
||||||
// console.log("body",body);
|
}
|
||||||
// console.log("id",id);
|
|
||||||
|
|
||||||
// // const res = await prisma.eventSponsor.create({
|
|
||||||
|
|
||||||
// // })
|
|
||||||
|
|
||||||
// return NextResponse.json({
|
|
||||||
// success: true,
|
|
||||||
// message: "Success create sponsor",
|
|
||||||
// });
|
|
||||||
// } catch (error) {
|
|
||||||
// return NextResponse.json(
|
|
||||||
// { success: false, message: "Failed create sponsor" },
|
|
||||||
// { status: 500 }
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,4 +43,7 @@ export const RouterEvent = {
|
|||||||
`/dev/event/detail/sponsor/tambah_sponsor/${id}`,
|
`/dev/event/detail/sponsor/tambah_sponsor/${id}`,
|
||||||
detail_sponsor: ({ id }: { id: string }) =>
|
detail_sponsor: ({ id }: { id: string }) =>
|
||||||
`/dev/event/detail/detail_sponsor/${id}`,
|
`/dev/event/detail/detail_sponsor/${id}`,
|
||||||
|
|
||||||
|
nominal_sponsor: ({ id }: { id: string }) =>
|
||||||
|
`/dev/event/detail/sponsor/nominal_sponsor/${id}`,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
|
import AdminGlobal_ComponentBackButton from "../../_admin_global/back_button";
|
||||||
import { AdminEvent_ViewDetailPeserta } from "../_view";
|
import { AdminEvent_ViewDetailPeserta } from "../_view";
|
||||||
import { MODEL_EVENT_PESERTA } from "@/app_modules/event/model/interface";
|
import { MODEL_EVENT_PESERTA } from "@/app_modules/event/_lib/interface";
|
||||||
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
|
import { ComponentAdminGlobal_TitlePage } from "../../_admin_global/_component";
|
||||||
|
|
||||||
export function AdminEvent_UiDetailPeserta({
|
export function AdminEvent_UiDetailPeserta({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { MODEL_EVENT_PESERTA } from "@/app_modules/event/model/interface";
|
import { MODEL_EVENT_PESERTA } from "@/app_modules/event/_lib/interface";
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
Button,
|
Button,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
ComponentGlobal_NotifikasiGagal,
|
ComponentGlobal_NotifikasiGagal,
|
||||||
ComponentGlobal_NotifikasiPeringatan,
|
ComponentGlobal_NotifikasiPeringatan,
|
||||||
} from "@/app_modules/_global/notif_global";
|
} from "@/app_modules/_global/notif_global";
|
||||||
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
|
||||||
import {
|
import {
|
||||||
Affix,
|
Affix,
|
||||||
Box,
|
Box,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||||
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function AdminEvent_funEditCatatanById(
|
export async function AdminEvent_funEditCatatanById(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
import { RouterAdminEvent } from "@/app/lib/router_admin/router_admin_event";
|
||||||
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useDisclosure } from "@mantine/hooks";
|
import { useDisclosure } from "@mantine/hooks";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import { MODEL_EVENT } from "@/app_modules/event/model/interface";
|
import { MODEL_EVENT } from "@/app_modules/event/_lib/interface";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
import ComponentAdminGlobal_HeaderTamplate from "../../_admin_global/header_tamplate";
|
||||||
import { adminEvent_funGetListReject } from "../fun";
|
import { adminEvent_funGetListReject } from "../fun";
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { IEventSponsor } from "./interface";
|
||||||
|
|
||||||
export const apiGetEventDetailById = async ({ id }: { id: string }) => {
|
export const apiGetEventDetailById = async ({ id }: { id: string }) => {
|
||||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||||
if (!token) return await token.json().catch(() => null);
|
if (!token) return await token.json().catch(() => null);
|
||||||
@@ -68,14 +70,14 @@ export const apiGetEventCreateSponsor = async ({
|
|||||||
data,
|
data,
|
||||||
}: {
|
}: {
|
||||||
id: string;
|
id: string;
|
||||||
data: any;
|
data: IEventSponsor;
|
||||||
}) => {
|
}) => {
|
||||||
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
const { token } = await fetch("/api/get-cookie").then((res) => res.json());
|
||||||
if (!token) return await token.json().catch(() => null);
|
if (!token) return await token.json().catch(() => null);
|
||||||
|
|
||||||
const response = await fetch(`/api/event/sponsor/${id}`, {
|
const response = await fetch(`/api/event/sponsor/${id}`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: data,
|
body: JSON.stringify(data),
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
|
|||||||
@@ -30,6 +30,21 @@ export interface MODEL_EVENT_PESERTA {
|
|||||||
userId: string;
|
userId: string;
|
||||||
User: MODEL_USER;
|
User: MODEL_USER;
|
||||||
eventId: string;
|
eventId: string;
|
||||||
isPresent: boolean
|
isPresent: boolean;
|
||||||
Event: MODEL_EVENT;
|
Event: MODEL_EVENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IEventSponsor {
|
||||||
|
id?: string;
|
||||||
|
isActive?: boolean;
|
||||||
|
createdAt?: Date;
|
||||||
|
updatedAt?: Date;
|
||||||
|
name?: string;
|
||||||
|
fileName?: string;
|
||||||
|
fileExt?: string;
|
||||||
|
fileId?: string;
|
||||||
|
eventId?: string;
|
||||||
|
Event?: MODEL_EVENT;
|
||||||
|
authorId?: string;
|
||||||
|
Author?: MODEL_USER;
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ import { useState } from "react";
|
|||||||
import { event_funUpdateKehadiran } from "../fun";
|
import { event_funUpdateKehadiran } from "../fun";
|
||||||
import { Event_funJoinAndConfirmEvent } from "../fun/create/fun_join_and_confirm";
|
import { Event_funJoinAndConfirmEvent } from "../fun/create/fun_join_and_confirm";
|
||||||
import { gs_event_hotMenu } from "../global_state";
|
import { gs_event_hotMenu } from "../global_state";
|
||||||
import { MODEL_EVENT } from "../model/interface";
|
import { MODEL_EVENT } from "../_lib/interface";
|
||||||
import { Event_funJoinEvent } from "../fun/create/fun_join_event";
|
import { Event_funJoinEvent } from "../fun/create/fun_join_event";
|
||||||
import "moment/locale/id";
|
import "moment/locale/id";
|
||||||
import { apiGetEventDetailById } from "../_lib/api_event";
|
import { apiGetEventDetailById } from "../_lib/api_event";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
import { Card, Group, Stack, Text, Title } from "@mantine/core";
|
import { Card, Group, Stack, Text, Title } from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { MODEL_EVENT } from "../model/interface";
|
import { MODEL_EVENT } from "../_lib/interface";
|
||||||
|
|
||||||
export default function ComponentEvent_BoxListStatus({
|
export default function ComponentEvent_BoxListStatus({
|
||||||
data,
|
data,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { MODEL_EVENT_PESERTA } from "../../model/interface";
|
import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
|
||||||
|
|
||||||
export function ComponentEvent_CardKontributor({
|
export function ComponentEvent_CardKontributor({
|
||||||
data,
|
data,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
} from "@/app_modules/_global/component";
|
} from "@/app_modules/_global/component";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
|
||||||
export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) {
|
export function ComponentEvent_CardRiwayat({ data }: { data: MODEL_EVENT }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||||
import { Grid, Stack, Text, Title } from "@mantine/core";
|
import { Grid, Stack, Text, Title } from "@mantine/core";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
import { MainColor } from "@/app_modules/_global/color";
|
import { MainColor } from "@/app_modules/_global/color";
|
||||||
import { Event_ComponentSkeletonDetailData } from "../skeleton/comp_skeleton_detail_data";
|
import { Event_ComponentSkeletonDetailData } from "../skeleton/comp_skeleton_detail_data";
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import "moment/locale/id";
|
|||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { apiGetEventDetailById } from "../../_lib/api_event";
|
import { apiGetEventDetailById } from "../../_lib/api_event";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
import { Event_ComponentSkeletonDetail } from "../skeleton/comp_skeleton_detail";
|
import { Event_ComponentSkeletonDetail } from "../skeleton/comp_skeleton_detail";
|
||||||
import Event_ComponentBoxDaftarPeserta from "./comp_box_daftar_peserta";
|
import Event_ComponentBoxDaftarPeserta from "./comp_box_daftar_peserta";
|
||||||
import Event_ComponentBoxDaftarSponsor from "./comp_box_sponsor";
|
import Event_ComponentBoxDaftarSponsor from "./comp_box_sponsor";
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
ComponentGlobal_LoaderAvatar,
|
ComponentGlobal_LoaderAvatar,
|
||||||
} from "@/app_modules/_global/component";
|
} from "@/app_modules/_global/component";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { MODEL_EVENT_PESERTA } from "../../model/interface";
|
import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
|
||||||
import { Prisma } from "@prisma/client";
|
import { Prisma } from "@prisma/client";
|
||||||
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
import { RouterProfile } from "@/app/lib/router_hipmi/router_katalog";
|
||||||
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { Event_ComponentSkeletonDetailData } from "../../component";
|
|||||||
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
||||||
import { Event_funDeleteById } from "../../fun/delete/fun_delete";
|
import { Event_funDeleteById } from "../../fun/delete/fun_delete";
|
||||||
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { Stack, Loader, Center } from "@mantine/core";
|
import { Stack, Loader, Center } from "@mantine/core";
|
||||||
import ComponentEvent_ListPeserta from "../../component/detail/list_peserta";
|
import ComponentEvent_ListPeserta from "../../component/detail/list_peserta";
|
||||||
import { MODEL_EVENT_PESERTA } from "../../model/interface";
|
import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
|
||||||
import { useParams } from "next/navigation";
|
import { useParams } from "next/navigation";
|
||||||
import ComponentEvent_ListPesertaNew from "../../component/detail/list_peserta_new";
|
import ComponentEvent_ListPesertaNew from "../../component/detail/list_peserta_new";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
||||||
import ComponentEvent_ListPeserta from "../../component/detail/list_peserta";
|
import ComponentEvent_ListPeserta from "../../component/detail/list_peserta";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
|
||||||
export default function Event_DetailPublish({
|
export default function Event_DetailPublish({
|
||||||
dataEvent,
|
dataEvent,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { useState } from "react";
|
|||||||
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
||||||
import { Event_funDeleteById } from "../../fun/delete/fun_delete";
|
import { Event_funDeleteById } from "../../fun/delete/fun_delete";
|
||||||
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
import ComponentEvent_DetailData from "../../component/detail/detail_data";
|
||||||
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
import { Event_funEditStatusById } from "../../fun/edit/fun_edit_status_by_id";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
import { IRealtimeData } from "@/app/lib/global_state";
|
import { IRealtimeData } from "@/app/lib/global_state";
|
||||||
import { WibuRealtime } from "wibu-pkg";
|
import { WibuRealtime } from "wibu-pkg";
|
||||||
import { event_checkStatus } from "../../fun/get/fun_check_status_by_id";
|
import { event_checkStatus } from "../../fun/get/fun_check_status_by_id";
|
||||||
|
|||||||
@@ -1,9 +1,24 @@
|
|||||||
'use client';
|
"use client";
|
||||||
import { AccentColor, MainColor } from '@/app_modules/_global/color';
|
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
||||||
import { Box, Button, Group, Paper, Stack, Text, TextInput, Title } from '@mantine/core';
|
import {
|
||||||
import { IconChevronRight, IconMoodSmile, IconMoodSmileBeam, IconMoodSmileDizzy, IconMoodXd } from '@tabler/icons-react';
|
Box,
|
||||||
import { useRouter } from 'next/navigation';
|
Button,
|
||||||
import React from 'react';
|
Group,
|
||||||
|
Paper,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
Title,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import {
|
||||||
|
IconChevronRight,
|
||||||
|
IconMoodSmile,
|
||||||
|
IconMoodSmileBeam,
|
||||||
|
IconMoodSmileDizzy,
|
||||||
|
IconMoodXd,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
|
import { useParams, useRouter } from "next/navigation";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
const listNominal = [
|
const listNominal = [
|
||||||
{
|
{
|
||||||
@@ -28,7 +43,9 @@ const listNominal = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
function Event_PilihNominalSponsor() {
|
function Event_PilihNominalSponsor() {
|
||||||
|
const params = useParams<{ id: string }>();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
@@ -49,9 +66,7 @@ function Event_PilihNominalSponsor() {
|
|||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Group>
|
<Group>
|
||||||
{e.icon}
|
{e.icon}
|
||||||
<Title order={4}>
|
<Title order={4}>Rp.{e.jumlah}</Title>
|
||||||
Rp.{e.jumlah}
|
|
||||||
</Title>
|
|
||||||
</Group>
|
</Group>
|
||||||
<IconChevronRight />
|
<IconChevronRight />
|
||||||
</Group>
|
</Group>
|
||||||
@@ -79,15 +94,16 @@ function Event_PilihNominalSponsor() {
|
|||||||
Minimal Donasi Rp. 10.000
|
Minimal Donasi Rp. 10.000
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Paper >
|
</Paper>
|
||||||
<Button
|
<Button
|
||||||
style={{ transition: "0.5s" }}
|
style={{ transition: "0.5s" }}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
bg={MainColor.yellow}
|
bg={MainColor.yellow}
|
||||||
color="yellow"
|
color="yellow"
|
||||||
c={"black"}
|
c={"black"}
|
||||||
onClick={() => router.push("/dev/event/detail/sponsor/metode_pembayaran")}
|
onClick={() =>
|
||||||
|
router.push("/dev/event/detail/sponsor/metode_pembayaran")
|
||||||
|
}
|
||||||
>
|
>
|
||||||
Lanjutan Pembayaran
|
Lanjutan Pembayaran
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import {
|
|||||||
ComponentGlobal_NotifikasiPeringatan,
|
ComponentGlobal_NotifikasiPeringatan,
|
||||||
} from "@/app_modules/_global/notif_global";
|
} from "@/app_modules/_global/notif_global";
|
||||||
import { DIRECTORY_ID } from "@/app/lib";
|
import { DIRECTORY_ID } from "@/app/lib";
|
||||||
|
import { IEventSponsor } from "../../_lib/interface";
|
||||||
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
|
|
||||||
function Event_TambahSponsor() {
|
function Event_TambahSponsor() {
|
||||||
const params = useParams<{ id: string }>();
|
const params = useParams<{ id: string }>();
|
||||||
@@ -62,9 +64,11 @@ function Event_TambahSponsor() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = {
|
const fileType = file.type.split("/").pop();
|
||||||
|
const data: IEventSponsor = {
|
||||||
name: name,
|
name: name,
|
||||||
fileName: file.name,
|
fileName: file.name,
|
||||||
|
fileExt: fileType,
|
||||||
fileId: uploadFile.data.id,
|
fileId: uploadFile.data.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -73,9 +77,14 @@ function Event_TambahSponsor() {
|
|||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("res >>", created);
|
||||||
|
|
||||||
if (created) {
|
if (created) {
|
||||||
setIsLoading(false);
|
router.replace(RouterEvent.nominal_sponsor({ id: params.id }));
|
||||||
ComponentGlobal_NotifikasiBerhasil(created.message);
|
ComponentGlobal_NotifikasiBerhasil(created.message);
|
||||||
|
} else {
|
||||||
|
setIsLoading(false);
|
||||||
|
ComponentGlobal_NotifikasiPeringatan(created.message);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
@@ -168,7 +177,7 @@ function Event_TambahSponsor() {
|
|||||||
loaderPosition="center"
|
loaderPosition="center"
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// onCreated();
|
onCreated();
|
||||||
}}
|
}}
|
||||||
bg={MainColor.yellow}
|
bg={MainColor.yellow}
|
||||||
color="yellow"
|
color="yellow"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.share
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Event_funEditById } from "../fun/edit/fun_edit_by_id";
|
import { Event_funEditById } from "../fun/edit/fun_edit_by_id";
|
||||||
import { MODEL_EVENT } from "../model/interface";
|
import { MODEL_EVENT } from "../_lib/interface";
|
||||||
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
|
import ComponentEvent_ErrorMaximalInput from "../component/error_maksimal_input";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { MODEL_EVENT_PESERTA } from "../../model/interface";
|
import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function Event_funJoinAndConfirmEvent(data: MODEL_EVENT_PESERTA) {
|
export async function Event_funJoinAndConfirmEvent(data: MODEL_EVENT_PESERTA) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { MODEL_EVENT_PESERTA } from "../../model/interface";
|
import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
export async function Event_funJoinEvent(data: MODEL_EVENT_PESERTA) {
|
export async function Event_funJoinEvent(data: MODEL_EVENT_PESERTA) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
|
||||||
export async function Event_funEditById(data: MODEL_EVENT) {
|
export async function Event_funEditById(data: MODEL_EVENT) {
|
||||||
const updt = await prisma.event.update({
|
const updt = await prisma.event.update({
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import { ScrollOnly } from "next-scroll-loader";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { ComponentEvent_CardBeranda } from "../component/card_view/card_beranda";
|
import { ComponentEvent_CardBeranda } from "../component/card_view/card_beranda";
|
||||||
import { event_getListAllPublish } from "../fun/get/get_list_all_publish";
|
import { event_getListAllPublish } from "../fun/get/get_list_all_publish";
|
||||||
import { MODEL_EVENT } from "../model/interface";
|
import { MODEL_EVENT } from "../_lib/interface";
|
||||||
import { Event_ComponentSkeletonBeranda } from "../component";
|
import { Event_ComponentSkeletonBeranda } from "../component";
|
||||||
import { API_RouteEvent } from "@/app/lib/api_user_router/route_api_event";
|
import { API_RouteEvent } from "@/app/lib/api_user_router/route_api_event";
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { ScrollOnly } from "next-scroll-loader";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { ComponentEvent_CardKontributor } from "../../component/card_view/card_kontributor";
|
import { ComponentEvent_CardKontributor } from "../../component/card_view/card_kontributor";
|
||||||
import { event_getListKontibusiByUserId } from "../../fun/get/get_list_kontribusi_by_user_id";
|
import { event_getListKontibusiByUserId } from "../../fun/get/get_list_kontribusi_by_user_id";
|
||||||
import { MODEL_EVENT_PESERTA } from "../../model/interface";
|
import { MODEL_EVENT_PESERTA } from "../../_lib/interface";
|
||||||
|
|
||||||
export default function Event_Kontribusi({
|
export default function Event_Kontribusi({
|
||||||
listKontribusi,
|
listKontribusi,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
} from "@/app_modules/_global/color/color_pallet";
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
import Event_RiwayatSaya from "./saya";
|
import Event_RiwayatSaya from "./saya";
|
||||||
import Event_SemuaRiwayat from "./semua";
|
import Event_SemuaRiwayat from "./semua";
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
|
import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
|
||||||
import { event_getListSemuaRiwayat } from "../../fun/get/riwayat/get_list_semua_riwayat";
|
import { event_getListSemuaRiwayat } from "../../fun/get/riwayat/get_list_semua_riwayat";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
import { event_getListRiwayatSaya } from "../../fun/get/riwayat/get_list_riwayat_saya";
|
import { event_getListRiwayatSaya } from "../../fun/get/riwayat/get_list_riwayat_saya";
|
||||||
|
|
||||||
export default function Event_RiwayatSaya({
|
export default function Event_RiwayatSaya({
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
|
import { ComponentEvent_CardRiwayat } from "../../component/card_view/card_riwayat";
|
||||||
import { event_getListSemuaRiwayat } from "../../fun/get/riwayat/get_list_semua_riwayat";
|
import { event_getListSemuaRiwayat } from "../../fun/get/riwayat/get_list_semua_riwayat";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
|
||||||
export default function Event_SemuaRiwayat({
|
export default function Event_SemuaRiwayat({
|
||||||
listData,
|
listData,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { ScrollOnly } from "next-scroll-loader";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
|
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
|
||||||
import { event_getAllDraft } from "../../fun/get/status/get_all_draft";
|
import { event_getAllDraft } from "../../fun/get/status/get_all_draft";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
|
||||||
export default function Event_StatusDraft({
|
export default function Event_StatusDraft({
|
||||||
listDraft,
|
listDraft,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { ScrollOnly } from "next-scroll-loader";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
|
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
|
||||||
import { event_getAllByStatusId } from "../../fun";
|
import { event_getAllByStatusId } from "../../fun";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
|
||||||
export default function Event_StatusPublish({
|
export default function Event_StatusPublish({
|
||||||
listPublish,
|
listPublish,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { ScrollOnly } from "next-scroll-loader";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
|
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
|
||||||
import { event_getAllReject } from "../../fun/get/status/get_all_reject";
|
import { event_getAllReject } from "../../fun/get/status/get_all_reject";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
|
||||||
export default function Event_StatusReject({
|
export default function Event_StatusReject({
|
||||||
listReject,
|
listReject,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { ScrollOnly } from "next-scroll-loader";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
|
import ComponentEvent_BoxListStatus from "../../component/box_list_status";
|
||||||
import { event_getAllReview } from "../../fun/get/status/get_all_review";
|
import { event_getAllReview } from "../../fun/get/status/get_all_review";
|
||||||
import { MODEL_EVENT } from "../../model/interface";
|
import { MODEL_EVENT } from "../../_lib/interface";
|
||||||
|
|
||||||
export default function Event_StatusReview({
|
export default function Event_StatusReview({
|
||||||
listReview,
|
listReview,
|
||||||
|
|||||||
Reference in New Issue
Block a user