@@ -1,10 +1,12 @@
|
|||||||
import { prisma } from "@/app/lib";
|
import { prisma } from "@/app/lib";
|
||||||
import { data } from "autoprefixer";
|
import { data } from "autoprefixer";
|
||||||
import { NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: NextRequest) {
|
||||||
const { searchParams } = new URL(request.url);
|
const id = request.nextUrl.searchParams.get("id");
|
||||||
const id = searchParams.get("id");
|
// const { searchParams } = new URL(request.url);
|
||||||
|
// const id = searchParams.get("id");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await prisma.kodeOtp.findFirst({
|
const data = await prisma.kodeOtp.findFirst({
|
||||||
@@ -12,10 +14,10 @@ export async function GET(request: Request) {
|
|||||||
id: id as string,
|
id: id as string,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return new Response(JSON.stringify({ data }), { status: 200 });
|
return NextResponse.json(data, { status: 200 });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Response(JSON.stringify({ data: null }), { status: 404 });
|
return NextResponse.json(null, { status: 500 });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,11 +18,8 @@ export async function POST(req: Request) {
|
|||||||
|
|
||||||
const sendWa = await res.json();
|
const sendWa = await res.json();
|
||||||
if (sendWa.status !== "success")
|
if (sendWa.status !== "success")
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({
|
{ success: false, message: "Nomor Whatsapp Tidak Aktif" },
|
||||||
success: false,
|
|
||||||
message: "Nomor Whatsapp Tidak Aktif",
|
|
||||||
}),
|
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -34,32 +31,30 @@ export async function POST(req: Request) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!createOtpId)
|
if (!createOtpId)
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({
|
{ success: false, message: "Gagal Membuat Kode OTP" },
|
||||||
success: false,
|
|
||||||
message: "Gagal Membuat Kode OTP",
|
|
||||||
}),
|
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
|
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({
|
{
|
||||||
success: true,
|
success: true,
|
||||||
message: "Kode Verifikasi Dikirim",
|
message: "Kode Verifikasi Dikirim",
|
||||||
kodeId: createOtpId.id,
|
kodeId: createOtpId.id,
|
||||||
}),
|
},
|
||||||
{ status: 200 }
|
{ status: 200 }
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return new Response(
|
|
||||||
JSON.stringify({
|
return NextResponse.json(
|
||||||
success: false,
|
{ success: false, message: "Server Whatsapp Error !! " },
|
||||||
message: "Server Whatsapp Error !!",
|
|
||||||
}),
|
|
||||||
{ status: 500 }
|
{ status: 500 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NextResponse.json({ success: false });
|
return NextResponse.json(
|
||||||
|
{ success: false, message: "Method Not Allowed" },
|
||||||
|
{ status: 405 }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,21 @@
|
|||||||
import { prisma } from "@/app/lib";
|
import { prisma } from "@/app/lib";
|
||||||
import { cookies } from "next/headers";
|
import { cookies } from "next/headers";
|
||||||
export async function GET(request: Request) {
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
const { searchParams } = new URL(request.url);
|
export const dynamic = "force-dynamic";
|
||||||
const id = searchParams.get("id");
|
export async function GET(request: NextRequest) {
|
||||||
|
const id = request.nextUrl.searchParams.get("id");
|
||||||
|
// const { searchParams } = new URL(request.url);
|
||||||
|
// const id = searchParams.get("id");
|
||||||
|
|
||||||
const delToken = await prisma.userSession.delete({
|
const delToken = await prisma.userSession.delete({
|
||||||
where: {
|
where: {
|
||||||
userId: id as string,
|
userId: id as string,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const del = cookies().delete(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
|
const del = cookies().delete(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
|
||||||
return new Response(JSON.stringify({ success: true, message: "Logout Berhasil" }), {status: 200});
|
return NextResponse.json(
|
||||||
}
|
{ success: true, message: "Logout Berhasil" },
|
||||||
|
{ status: 200 }
|
||||||
// import { cookies } from "next/headers";
|
);
|
||||||
// import { NextResponse } from "next/server";
|
}
|
||||||
|
|
||||||
// export async function GET() {
|
|
||||||
// cookies().set({
|
|
||||||
// name: "mySession",
|
|
||||||
// value: "",
|
|
||||||
// maxAge: 0,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// return NextResponse.json({ status: 200, message: "Logout" });
|
|
||||||
// }
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { sessionCreate } from "@/app/auth/_lib/session_create";
|
import { sessionCreate } from "@/app/auth/_lib/session_create";
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function POST(req: Request) {
|
export async function POST(req: Request) {
|
||||||
if (req.method === "POST") {
|
if (req.method === "POST") {
|
||||||
@@ -12,11 +13,8 @@ export async function POST(req: Request) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (cekUsername)
|
if (cekUsername)
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({
|
{ success: false, message: "Username sudah digunakan" },
|
||||||
success: false,
|
|
||||||
message: "Username sudah digunakan",
|
|
||||||
}),
|
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -43,28 +41,22 @@ export async function POST(req: Request) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!createUserSession)
|
if (!createUserSession)
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({
|
{ success: false, message: "Gagal Membuat Session" },
|
||||||
success: false,
|
|
||||||
message: "Gagal Membuat Session",
|
|
||||||
}),
|
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({
|
{ success: true, message: "Berhasil Login", data: createUser },
|
||||||
success: true,
|
|
||||||
message: "Berhasil Login",
|
|
||||||
}),
|
|
||||||
|
|
||||||
{ status: 200 }
|
{ status: 200 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return new Response(
|
|
||||||
JSON.stringify({ success: false, message: "Method Not Allowed" }),
|
return NextResponse.json(
|
||||||
|
{ success: false, message: "Method Not Allowed" },
|
||||||
{ status: 405 }
|
{ status: 405 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ export async function POST(req: Request) {
|
|||||||
|
|
||||||
const sendWa = await res.json();
|
const sendWa = await res.json();
|
||||||
if (sendWa.status !== "success")
|
if (sendWa.status !== "success")
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({
|
{
|
||||||
success: false,
|
success: false,
|
||||||
message: "Nomor Whatsapp Tidak Aktif",
|
message: "Nomor Whatsapp Tidak Aktif",
|
||||||
}),
|
},
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -34,32 +34,36 @@ export async function POST(req: Request) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!createOtpId)
|
if (!createOtpId)
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({
|
{
|
||||||
success: false,
|
success: false,
|
||||||
message: "Gagal Membuat Kode OTP",
|
message: "Gagal Membuat Kode OTP",
|
||||||
}),
|
},
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
|
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({
|
{
|
||||||
success: true,
|
success: true,
|
||||||
message: "Kode Verifikasi Dikirim",
|
message: "Kode Verifikasi Dikirim",
|
||||||
kodeId: createOtpId.id,
|
kodeId: createOtpId.id,
|
||||||
}),
|
},
|
||||||
{ status: 200 }
|
{ status: 200 }
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
return new Response(
|
|
||||||
JSON.stringify({
|
return NextResponse.json(
|
||||||
|
{
|
||||||
success: false,
|
success: false,
|
||||||
message: "Server Whatsapp Error !!",
|
message: "Server Whatsapp Error !!",
|
||||||
}),
|
},
|
||||||
{ status: 500 }
|
{ status: 500 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NextResponse.json({ success: false });
|
return NextResponse.json(
|
||||||
|
{ success: false, message: "Method Not Allowed" },
|
||||||
|
{ status: 405 }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
import { sessionCreate } from "@/app/auth/_lib/session_create";
|
import { sessionCreate } from "@/app/auth/_lib/session_create";
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
import { ServerEnv } from "@/app/lib/server_env";
|
|
||||||
import { sealData } from "iron-session";
|
|
||||||
import { revalidatePath } from "next/cache";
|
|
||||||
import { cookies } from "next/headers";
|
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function POST(req: Request) {
|
export async function POST(req: Request) {
|
||||||
@@ -23,10 +19,9 @@ export async function POST(req: Request) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (dataUser === null)
|
if (dataUser === null)
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({ success: false, message: "Nomor Belum Terdaftar" }),
|
{ success: false, message: "Nomor Belum Terdaftar" },
|
||||||
{ status: 404 }
|
{ status: 404 }
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -59,49 +54,27 @@ export async function POST(req: Request) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!createUserSession)
|
if (!createUserSession)
|
||||||
return new Response(
|
return NextResponse.json(
|
||||||
JSON.stringify({ success: false, message: "Gagal Membuat Session" }),
|
{ success: false, message: "Gagal Membuat Session" },
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (data) {
|
return NextResponse.json(
|
||||||
// const res = await sealData(
|
{
|
||||||
// JSON.stringify({
|
|
||||||
// id: data.id,
|
|
||||||
// username: data.username,
|
|
||||||
// }),
|
|
||||||
// {
|
|
||||||
// password: ServerEnv.value?.WIBU_PWD as string,
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
|
|
||||||
// cookies().set({
|
|
||||||
// name: "mySession",
|
|
||||||
// value: res,
|
|
||||||
// maxAge: 60 * 60 * 24 * 7,
|
|
||||||
// });
|
|
||||||
|
|
||||||
// revalidatePath("/dev/home");
|
|
||||||
|
|
||||||
// return NextResponse.json({ status: 200, data });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return NextResponse.json({ success: true });
|
|
||||||
return new Response(
|
|
||||||
JSON.stringify({
|
|
||||||
success: true,
|
success: true,
|
||||||
message: "Berhasil Login",
|
message: "Berhasil Login",
|
||||||
roleId: dataUser.masterUserRoleId,
|
roleId: dataUser.masterUserRoleId,
|
||||||
active: dataUser.active,
|
active: dataUser.active,
|
||||||
}),
|
},
|
||||||
{ status: 200 }
|
{ status: 200 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return new Response(
|
|
||||||
JSON.stringify({ success: false, message: "Method Not Allowed" }),
|
return NextResponse.json(
|
||||||
|
{ success: false, message: "Method Not Allowed" },
|
||||||
{ status: 405 }
|
{ status: 405 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export async function GET(req: Request) {
|
|||||||
|
|
||||||
if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value)) {
|
if (!c || !c?.value || _.isEmpty(c?.value) || _.isUndefined(c?.value)) {
|
||||||
return NextResponse.json({ success: false });
|
return NextResponse.json({ success: false });
|
||||||
// return new Response(JSON.stringify({ success: false }));
|
|
||||||
}
|
}
|
||||||
return NextResponse.json({ success: true });
|
return NextResponse.json({ success: true });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { event_newGetListPesertaById } from "@/app_modules/event/fun";
|
import { event_newGetListPesertaById } from "@/app_modules/event/fun";
|
||||||
|
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
|
||||||
import { toNumber } from "lodash";
|
import { toNumber } from "lodash";
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { headers } from "next/headers";
|
import { headers } from "next/headers";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
export async function GET(req: Request) {
|
export async function GET(req: Request) {
|
||||||
const origin = new URL(req.url).origin;
|
const origin = new URL(req.url).origin;
|
||||||
|
|
||||||
return new Response(JSON.stringify({ success: true, origin }));
|
return NextResponse.json({ success: true, origin });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function GET(req: Request) {
|
export async function GET(req: Request) {
|
||||||
const page = new URL(req.url).searchParams.get("page");
|
const page = new URL(req.url).searchParams.get("page");
|
||||||
if (!page) return new Response("page require", { status: 400 });
|
if (!page)
|
||||||
|
return NextResponse.json({ message: "Page not found" }, { status: 400 });
|
||||||
|
|
||||||
const res = await prisma.projectCollaboration_Message.findMany({
|
const res = await prisma.projectCollaboration_Message.findMany({
|
||||||
take: 5,
|
take: 5,
|
||||||
skip: +page * 5 - 5,
|
skip: +page * 5 - 5,
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function GET(req: Request) {
|
export async function GET(req: Request) {
|
||||||
const auth = req.headers.get("Authorization");
|
const auth = req.headers.get("Authorization");
|
||||||
const token = auth?.split(" ")[1];
|
const token = auth?.split(" ")[1];
|
||||||
if (!token)
|
if (!token) return NextResponse.json({ success: false }, { status: 401 });
|
||||||
return new Response(JSON.stringify({ success: false }), { status: 401 });
|
return NextResponse.json({ success: true });
|
||||||
return new Response(JSON.stringify({ success: true }));
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { headers } from "next/headers";
|
import { headers } from "next/headers";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
export async function GET(
|
export async function GET(
|
||||||
req: Request) {
|
req: Request) {
|
||||||
const origin = new URL(req.url).origin;
|
const origin = new URL(req.url).origin;
|
||||||
|
|
||||||
return new Response(JSON.stringify({ success: true, origin }));
|
return NextResponse.json({ success: true, origin });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { prisma } from "@/app/lib";
|
import { prisma } from "@/app/lib";
|
||||||
import { sessionCreate } from "../../_lib/session_create";
|
import { sessionCreate } from "../../_lib/session_create";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function POST(req: Request) {
|
export async function POST(req: Request) {
|
||||||
const user = await prisma.user.findUnique({
|
const user = await prisma.user.findUnique({
|
||||||
@@ -12,10 +13,7 @@ export async function POST(req: Request) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!user)
|
if (!user) return NextResponse.json({ success: false }, { status: 404 });
|
||||||
return new Response(
|
|
||||||
JSON.stringify({ success: false, message: "User not found" }), {status: 404}
|
|
||||||
);
|
|
||||||
|
|
||||||
const token = await sessionCreate({
|
const token = await sessionCreate({
|
||||||
sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
|
sessionKey: process.env.NEXT_PUBLIC_BASE_SESSION_KEY!,
|
||||||
@@ -23,5 +21,5 @@ export async function POST(req: Request) {
|
|||||||
user: user as any,
|
user: user as any,
|
||||||
});
|
});
|
||||||
|
|
||||||
return new Response(JSON.stringify({ success: true, token }));
|
return NextResponse.json({ success: true, token });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import { cookies } from "next/headers";
|
import { cookies } from "next/headers";
|
||||||
|
import { NextResponse } from "next/server";
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
const del = cookies().delete(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
|
const del = cookies().delete(process.env.NEXT_PUBLIC_BASE_SESSION_KEY!);
|
||||||
return new Response(JSON.stringify({ success: true }));
|
|
||||||
|
return NextResponse.json({ success: true, message: "Logout Berhasil" });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
import { newFunGetUserId } from "@/app/lib/new_fun_user_id";
|
import { newFunGetUserId } from "@/app/lib/new_fun_user_id";
|
||||||
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
|
|
||||||
import Ui_Konfirmasi from "@/app_modules/event/_ui/konfirmasi";
|
import Ui_Konfirmasi from "@/app_modules/event/_ui/konfirmasi";
|
||||||
import { event_funCheckPesertaByUserId } from "@/app_modules/event/fun";
|
|
||||||
import { event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
|
||||||
import moment from "moment";
|
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
|
|
||||||
export default async function Page({
|
export default async function Page({
|
||||||
params,
|
params,
|
||||||
|
|||||||
@@ -1,38 +1,33 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import {
|
import { API_RouteEvent } from "@/app/lib/api_user_router/route_api_event";
|
||||||
UIGlobal_LayoutDefault,
|
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
||||||
UIGlobal_LayoutTamplate,
|
import { MainColor } from "@/app_modules/_global/color";
|
||||||
} from "@/app_modules/_global/ui";
|
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
||||||
import {
|
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Center,
|
|
||||||
Group,
|
|
||||||
Paper,
|
|
||||||
Skeleton,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { MODEL_EVENT } from "../model/interface";
|
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
|
||||||
import { AccentColor, MainColor } from "@/app_modules/_global/color";
|
|
||||||
import { event_funCheckKehadiran, event_funUpdateKehadiran } from "../fun";
|
|
||||||
import {
|
import {
|
||||||
ComponentGlobal_NotifikasiBerhasil,
|
ComponentGlobal_NotifikasiBerhasil,
|
||||||
ComponentGlobal_NotifikasiGagal,
|
ComponentGlobal_NotifikasiGagal,
|
||||||
} from "@/app_modules/_global/notif_global";
|
} from "@/app_modules/_global/notif_global";
|
||||||
import { redirect, useRouter } from "next/navigation";
|
import {
|
||||||
import { RouterEvent } from "@/app/lib/router_hipmi/router_event";
|
UIGlobal_LayoutDefault
|
||||||
import { useState } from "react";
|
} from "@/app_modules/_global/ui";
|
||||||
import { API_RouteEvent } from "@/app/lib/api_user_router/route_api_event";
|
import {
|
||||||
import { ComponentGlobal_CardStyles } from "@/app_modules/_global/component";
|
Button,
|
||||||
import moment from "moment";
|
Center,
|
||||||
import { gs_event_hotMenu } from "../global_state";
|
Group,
|
||||||
|
Skeleton,
|
||||||
|
Stack,
|
||||||
|
Text
|
||||||
|
} from "@mantine/core";
|
||||||
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { Event_funJoinEvent } from "../fun/create/fun_join_event";
|
import moment from "moment";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
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 { MODEL_EVENT } from "../model/interface";
|
||||||
|
|
||||||
export default function Ui_Konfirmasi({
|
export default function Ui_Konfirmasi({
|
||||||
userLoginId,
|
userLoginId,
|
||||||
@@ -70,7 +65,6 @@ export default function Ui_Konfirmasi({
|
|||||||
API_RouteEvent.check_peserta({ eventId: eventId, userId: userLoginId })
|
API_RouteEvent.check_peserta({ eventId: eventId, userId: userLoginId })
|
||||||
);
|
);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
console.log("cek peserta", data);
|
|
||||||
setIsJoin(data);
|
setIsJoin(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,9 +81,6 @@ export default function Ui_Konfirmasi({
|
|||||||
setIsPresent(data);
|
setIsPresent(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log("kehadiran:", isPresent);
|
|
||||||
// console.log("data:", data);
|
|
||||||
|
|
||||||
if (data == null && isPresent == null) {
|
if (data == null && isPresent == null) {
|
||||||
return <SkeletonIsDataNull />;
|
return <SkeletonIsDataNull />;
|
||||||
}
|
}
|
||||||
@@ -102,7 +93,7 @@ export default function Ui_Konfirmasi({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moment(data?.tanggal).diff(moment(), "minute") < 0) {
|
if (moment(data?.tanggalSelesai).diff(moment(), "minute") < 0) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<EventAlreadyDone title={data?.title} eventId={eventId} />
|
<EventAlreadyDone title={data?.title} eventId={eventId} />
|
||||||
|
|||||||
Reference in New Issue
Block a user