auto push
This commit is contained in:
BIN
public/file/3b4b9575-b5c9-422a-b1cc-605ed6ce61a3.pdf
Normal file
BIN
public/file/3b4b9575-b5c9-422a-b1cc-605ed6ce61a3.pdf
Normal file
Binary file not shown.
BIN
public/investasi/e00ed6c8-d61c-4fb9-9488-cea776702644.jpeg
Normal file
BIN
public/investasi/e00ed6c8-d61c-4fb9-9488-cea776702644.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
BIN
public/portofolio/logo/3eee1fdc-7d42-4478-842c-2a386ce40be4.png
Normal file
BIN
public/portofolio/logo/3eee1fdc-7d42-4478-842c-2a386ce40be4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
BIN
public/portofolio/logo/fb7ee37b-6407-46a7-8691-92b24694edb0.png
Normal file
BIN
public/portofolio/logo/fb7ee37b-6407-46a7-8691-92b24694edb0.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
@@ -1,6 +1,6 @@
|
||||
import { AdminDonasi_TableReview } from "@/app_modules/admin/donasi";
|
||||
import { AdminDonasi_getByStatus } from "@/app_modules/admin/donasi/fun/get/get_list_donasi_by_status";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
const listReview = await AdminDonasi_getByStatus("2");
|
||||
|
||||
9
src/app/dev/admin/investasi/main/loading.tsx
Normal file
9
src/app/dev/admin/investasi/main/loading.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import ComponentAdminGlobal_LoadingPage from "@/app_modules/admin/component/loading_admin_page";
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<ComponentAdminGlobal_LoadingPage />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AdminLayout } from "@/app_modules/admin/main_dashboard";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import React from "react";
|
||||
|
||||
@@ -8,7 +8,7 @@ export default async function Layout({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const userId = await User_getUserId()
|
||||
const userId = await user_getOneUserId()
|
||||
const dataUser = await user_getOneById(userId)
|
||||
const userRole = dataUser?.masterUserRoleId
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ import { Colab_MainDetail } from "@/app_modules/colab";
|
||||
import colab_funCekPartisipasiById from "@/app_modules/colab/fun/get/cek_partisipasi_by_user_id";
|
||||
import colab_getListPartisipanById from "@/app_modules/colab/fun/get/get_list_partisipan_by_id";
|
||||
import colab_getOneCollaborationById from "@/app_modules/colab/fun/get/get_one_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let colabId = params.id;
|
||||
const userLoginId = await User_getUserId();
|
||||
const userLoginId = await user_getOneUserId();
|
||||
const dataColab = await colab_getOneCollaborationById(colabId);
|
||||
const listPartisipan = await colab_getListPartisipanById(colabId)
|
||||
const cekPartisipan = await colab_funCekPartisipasiById(colabId)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Colab_Beranda } from "@/app_modules/colab";
|
||||
import colab_getListAllProyek from "@/app_modules/colab/fun/get/get_list_all_proyek";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
const listData = await colab_getListAllProyek();
|
||||
const userLoginId = await User_getUserId();
|
||||
const userLoginId = await user_getOneUserId();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { CreateCeritaPenggalangDonasi } from "@/app_modules/donasi";
|
||||
import { Donasi_getTemporaryCreate } from "@/app_modules/donasi/fun/get/get_temporary_create";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
|
||||
const getTemporaryCreate = await Donasi_getTemporaryCreate(params.id);
|
||||
const userId = await User_getUserId()
|
||||
const userId = await user_getOneUserId()
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
Donasi_getMasterDurasi,
|
||||
Donasi_getMasterKategori,
|
||||
} from "@/app_modules/donasi/fun";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
const masterKategori = await Donasi_getMasterKategori();
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { DetailMainDonasi } from "@/app_modules/donasi";
|
||||
import { Donasi_getCountDonatur } from "@/app_modules/donasi/fun/count/get_count_donatur";
|
||||
import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let donasiId = params.id;
|
||||
const dataDonasi = await Donasi_getOneById(donasiId);
|
||||
const countDonatur = await Donasi_getCountDonatur(donasiId)
|
||||
const userLoginId = await User_getUserId();
|
||||
const userLoginId = await user_getOneUserId();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { DetailPublishDonasi } from "@/app_modules/donasi";
|
||||
import { Donasi_getCountDonatur } from "@/app_modules/donasi/fun/count/get_count_donatur";
|
||||
import { Donasi_getOneById } from "@/app_modules/donasi/fun/get/get_one_donasi_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const dataPublish = await Donasi_getOneById(params.id);
|
||||
const countDonatur= await Donasi_getCountDonatur(params.id)
|
||||
const userLoginId = await User_getUserId();
|
||||
const userLoginId = await user_getOneUserId();
|
||||
|
||||
console.log(userLoginId)
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { DonasiSayaDonasi } from "@/app_modules/donasi";
|
||||
import { Donasi_getInvoiceByAuthorId } from "@/app_modules/donasi/fun/get/get_list_invoice_by_author_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const listInvoice = await Donasi_getInvoiceByAuthorId(authorId);
|
||||
|
||||
return <DonasiSayaDonasi listInvoice={listInvoice as any} />;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { PostingDonasi } from "@/app_modules/donasi";
|
||||
import Donasi_getByStatus from "@/app_modules/donasi/fun/get/get_donasi_by_status";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const listPublish = await Donasi_getByStatus(authorId, "1")
|
||||
const listReview = await Donasi_getByStatus(authorId, "2");
|
||||
const listDraft = await Donasi_getByStatus(authorId, "3");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LayoutDonasi } from "@/app_modules/donasi";
|
||||
import { Donasi_getNotifByUserId } from "@/app_modules/donasi/fun/get/get_notif_by_user_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
@@ -8,7 +8,7 @@ export default async function Layout({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const userId = await User_getUserId();
|
||||
const userId = await user_getOneUserId();
|
||||
// console.log(userId)
|
||||
const isRead = await Donasi_getNotifByUserId(userId).then((res: any) =>
|
||||
res.map((val: any) => val.isRead)
|
||||
|
||||
@@ -2,7 +2,7 @@ import { PencairanDanaDonasi } from "@/app_modules/donasi";
|
||||
import { NotifPeringatan } from "@/app_modules/donasi/component/notifikasi/notif_peringatan";
|
||||
import { Donasi_getListPencairanDanaById } from "@/app_modules/donasi/fun/get/get_list_pencairan_dana_by_id";
|
||||
import { Donasi_getTotalPencairanDanaById } from "@/app_modules/donasi/fun/get/get_pencairan_dana_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { Loader } from "@mantine/core";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Donasi_MetodePembayaran } from "@/app_modules/donasi";
|
||||
import { Donasi_getMasterBank } from "@/app_modules/donasi/fun/master/get_bank";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({params}: {params: {id: string}}) {
|
||||
let donasiId= params.id
|
||||
const listBank = await Donasi_getMasterBank()
|
||||
const authorId = await User_getUserId()
|
||||
const authorId = await user_getOneUserId()
|
||||
|
||||
return<>
|
||||
<Donasi_MetodePembayaran listBank={listBank} donasiId={donasiId} authorId={authorId}/>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Event_Create } from "@/app_modules/event";
|
||||
import { Event_getMasterTipeAcara } from "@/app_modules/event/fun/master/get_tipe_acara";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import _ from "lodash";
|
||||
|
||||
export default async function Page() {
|
||||
const userId = await User_getUserId()
|
||||
const userId = await user_getOneUserId()
|
||||
const listTipeAcara = await Event_getMasterTipeAcara();
|
||||
|
||||
return <Event_Create listTipeAcara={listTipeAcara as any} authorId={userId}/>;
|
||||
|
||||
@@ -3,13 +3,13 @@ import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count
|
||||
import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id";
|
||||
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
|
||||
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let eventId = params.id;
|
||||
const dataEvent = await Event_getOneById(eventId);
|
||||
const listPeserta = await Event_getListPesertaById(eventId);
|
||||
const userLoginId = await User_getUserId();
|
||||
const userLoginId = await user_getOneUserId();
|
||||
const isJoin = await Event_CekUserJoinById(eventId, userLoginId);
|
||||
const totalPeserta = await Event_countTotalPesertaById(eventId)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Event_countTotalPesertaById } from "@/app_modules/event/fun/count/count
|
||||
import { Event_CekUserJoinById } from "@/app_modules/event/fun/get/cek_user_join_by_id";
|
||||
import { Event_getListPesertaById } from "@/app_modules/event/fun/get/get_list_peserta_by_id";
|
||||
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let eventId = params.id;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Event_Kontribusi } from "@/app_modules/event";
|
||||
import { Event_getListKontibusiByUserId } from "@/app_modules/event/fun/get/get_list_kontribusi_by_user_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
const userLoginId = await User_getUserId();
|
||||
const userLoginId = await user_getOneUserId();
|
||||
const listKontribusi = await Event_getListKontibusiByUserId(userLoginId)
|
||||
|
||||
return (
|
||||
|
||||
@@ -2,11 +2,11 @@ import { Event_Riwayat } from "@/app_modules/event";
|
||||
import { Event_getListRiwayatSaya } from "@/app_modules/event/fun/get/get_list_riwayat_saya";
|
||||
import { Event_getListSemuaRiwayat } from "@/app_modules/event/fun/get/get_list_semua_riwayat";
|
||||
import { Event_getOneById } from "@/app_modules/event/fun/get/get_one_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let eventId = params.id;
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const dataSemuaRiwayat = await Event_getListSemuaRiwayat();
|
||||
const dataRiwayatSaya = await Event_getListRiwayatSaya(authorId);
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Event_StatusPage } from "@/app_modules/event";
|
||||
import { Event_getByStatusId } from "@/app_modules/event/fun/get/get_event_by_status_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const listPublish = await Event_getByStatusId("1", authorId);
|
||||
const listReview = await Event_getByStatusId("2", authorId);
|
||||
const listDraft = await Event_getByStatusId("3", authorId);
|
||||
|
||||
@@ -2,12 +2,12 @@ import Forum_Detail from "@/app_modules/forum/detail";
|
||||
import { forum_getKomentarById } from "@/app_modules/forum/fun/get/get_komentar_by_id";
|
||||
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
||||
import { forum_countOneTotalKomentarById } from "@/app_modules/forum/fun/count/count_one_total_komentar_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let postingId = params.id;
|
||||
|
||||
const userLoginId = await User_getUserId()
|
||||
const userLoginId = await user_getOneUserId()
|
||||
const dataPosting = await forum_getOnePostingById(postingId);
|
||||
const listKomentar = await forum_getKomentarById(postingId);
|
||||
const totalKomentar = await forum_countOneTotalKomentarById(postingId)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { LayoutForum_Forumku } from "@/app_modules/forum";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import React from "react";
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { Forum_Forumku } from "@/app_modules/forum";
|
||||
import { forum_getListPostingByAuhtorId } from "@/app_modules/forum/fun/get/get_list_posting_by_author_id";
|
||||
import { forum_countOneTotalKomentarById } from "@/app_modules/forum/fun/count/count_one_total_komentar_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import _ from "lodash";
|
||||
import { forum_countPostingByAuthorId } from "@/app_modules/forum/fun/count/count_posting_by_author_id";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const authorId = params.id;
|
||||
const userLoginId = await User_getUserId()
|
||||
const userLoginId = await user_getOneUserId()
|
||||
const dataAuthor = await user_getOneById(authorId);
|
||||
const auhtorSelectedData = _.omit(dataAuthor, [
|
||||
"Profile.email",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Forum_Komentar } from "@/app_modules/forum";
|
||||
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let postingId = params.id;
|
||||
const dataPosting = await forum_getOnePostingById(postingId);
|
||||
const userLoginId = await User_getUserId()
|
||||
const userLoginId = await user_getOneUserId()
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { LayoutForum_Main } from "@/app_modules/forum";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import React from "react";
|
||||
|
||||
@@ -8,7 +8,7 @@ export default async function Layout({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const dataAuthor = await user_getOneById(authorId);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
|
||||
import { Forum_Beranda } from "@/app_modules/forum";
|
||||
import { forum_getListAllPosting } from "@/app_modules/forum/fun/get/get_list_all_posting";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page() {
|
||||
const listForum = await forum_getListAllPosting();
|
||||
const userLoginId = await User_getUserId();
|
||||
const userLoginId = await user_getOneUserId();
|
||||
return (
|
||||
<>
|
||||
<Forum_Beranda
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { HomeLayout } from "@/app_modules/home";
|
||||
import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default async function Layout({ children }: { children: any }) {
|
||||
const userId = await User_getUserId();
|
||||
const userId = await user_getOneUserId();
|
||||
const dataUser = await user_getOneById(userId);
|
||||
|
||||
return (
|
||||
|
||||
@@ -2,13 +2,13 @@ import { HomeView } from "@/app_modules/home";
|
||||
import { cookies } from "next/headers";
|
||||
import { unsealData } from "iron-session";
|
||||
import _ from "lodash";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
import { redirect } from "next/navigation";
|
||||
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
|
||||
|
||||
export default async function Page() {
|
||||
const userId = await User_getUserId();
|
||||
const userId = await user_getOneUserId();
|
||||
const dataUser = await user_getOneById(userId);
|
||||
|
||||
if (dataUser?.masterUserRoleId === "2" || dataUser?.masterUserRoleId === "3")
|
||||
|
||||
@@ -9,7 +9,7 @@ import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
||||
import yaml from "yaml";
|
||||
import fs from "fs";
|
||||
import { funGetListPortofolio } from "@/app_modules/katalog/portofolio/fun/get/get_list_portofolio";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { Profile_getOneById } from "@/app_modules/katalog/profile/fun/get/get_one_profile";
|
||||
import { Profile_getOneProfileAndUserById } from "@/app_modules/katalog/profile/fun/get/get_one_user_profile";
|
||||
import { user_getOneById } from "@/app_modules/home/fun/get/get_one_user_by_id";
|
||||
@@ -17,11 +17,10 @@ const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let profileId = params.id;
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const dataUser = await user_getOneById(authorId)
|
||||
const listPorto = await funGetListPortofolio(profileId);
|
||||
const dataProfile = await Profile_getOneProfileAndUserById(profileId);
|
||||
// console.log(dataProfile)
|
||||
|
||||
// await new Promise((a, b) => {
|
||||
// setTimeout(a, 1000);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Portofolio_EditDataBisnis } from "@/app_modules/katalog/portofolio";
|
||||
import { Portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||
import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||
import { Portofolio_getMasterBidangBisnis } from "@/app_modules/katalog/portofolio/fun/master/get_bidang_bisnis";
|
||||
import _ from "lodash";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let portoId = params.id;
|
||||
const data = await Portofolio_getOneById(portoId);
|
||||
const data = await portofolio_getOneById(portoId);
|
||||
const dataPorto = _.omit(data, [
|
||||
"Logo",
|
||||
"Portofolio_MediaSosial",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Portofolio_EditLogoBisnis } from "@/app_modules/katalog/portofolio";
|
||||
import { Portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||
import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||
import _ from "lodash";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let portoId = params.id;
|
||||
const dataPorto = await Portofolio_getOneById(portoId).then((res) =>
|
||||
const dataPorto = await portofolio_getOneById(portoId).then((res) =>
|
||||
_.omit(res, [
|
||||
"Logo",
|
||||
"MasterBidangBisnis",
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { PortofolioLayout } from "@/app_modules/katalog/portofolio";
|
||||
import { Portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||
|
||||
export default async function Layout({ children, params }: { children: any, params: {id: string} }) {
|
||||
let portoId = params.id
|
||||
const getPorto = await Portofolio_getOneById(portoId)
|
||||
|
||||
import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: any;
|
||||
params: { id: string };
|
||||
}) {
|
||||
let portoId = params.id;
|
||||
const getPorto = await portofolio_getOneById(portoId);
|
||||
const userLoginId = await user_getOneUserId();
|
||||
// console.log(userLoginId);
|
||||
// console.log(getPorto?.Profile?.User?.id);
|
||||
return (
|
||||
<>
|
||||
<PortofolioLayout portoId={portoId}>{children}</PortofolioLayout>
|
||||
<PortofolioLayout
|
||||
portoId={portoId}
|
||||
userLoginId={userLoginId}
|
||||
authorId={getPorto?.Profile?.User?.id as any}
|
||||
>
|
||||
{children}
|
||||
</PortofolioLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { ViewPortofolio } from "@/app_modules/katalog/portofolio";
|
||||
import { Portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||
import { portofolio_getOneById } from "@/app_modules/katalog/portofolio/fun/get/get_one_portofolio";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const getPorto = await Portofolio_getOneById(params.id);
|
||||
const getPorto = await portofolio_getOneById(params.id);
|
||||
const userLoginId = await user_getOneUserId()
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* {JSON.stringify(getPorto)} */}
|
||||
<ViewPortofolio dataPorto={getPorto as any} />
|
||||
<ViewPortofolio dataPorto={getPorto as any} userLoginId={userLoginId as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { CreateProfile } from "@/app_modules/katalog/profile";
|
||||
|
||||
export default async function Page({params}: {params: {id: string}}) {
|
||||
const userId = await User_getUserId()
|
||||
const userId = await user_getOneUserId()
|
||||
|
||||
return <>
|
||||
<CreateProfile userId={userId}/>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import MqttLoader from '@/util/mqtt_loader';
|
||||
// import MqttLoader from '@/util/mqtt_loader';
|
||||
import RootStyleRegistry from './emotion';
|
||||
|
||||
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<RootStyleRegistry>
|
||||
<MqttLoader />
|
||||
{/* <MqttLoader /> */}
|
||||
{children}</RootStyleRegistry>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,58 +1,58 @@
|
||||
"use client";
|
||||
|
||||
import { Box, Paper, SimpleGrid, Stack, Text, TextInput } from "@mantine/core";
|
||||
import ViewMakuro from "./_server/makuro_view";
|
||||
import mqtt_client from "@/util/mqtt_client";
|
||||
import { useState } from "react";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_coba_chat } from "./gs_coba";
|
||||
// import ViewMakuro from "./_server/makuro_view";
|
||||
// import mqtt_client from "@/util/mqtt_client";
|
||||
// import { useState } from "react";
|
||||
// import { useAtom } from "jotai";
|
||||
// import { gs_coba_chat } from "./gs_coba";
|
||||
|
||||
export default function Page() {
|
||||
const [data1, setData1] = useState("");
|
||||
const [data2, setData2] = useState("");
|
||||
// export default function Page() {
|
||||
// const [data1, setData1] = useState("");
|
||||
// const [data2, setData2] = useState("");
|
||||
|
||||
const [msg, setMsg] = useAtom(gs_coba_chat);
|
||||
// const [msg, setMsg] = useAtom(gs_coba_chat);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SimpleGrid cols={2} mt={"lg"}>
|
||||
<Stack align="center" justify="center">
|
||||
<TextInput
|
||||
label="User 1"
|
||||
value={data1}
|
||||
onChange={(val) => setData1(val.currentTarget.value)}
|
||||
/>
|
||||
<button
|
||||
onClick={() => {
|
||||
mqtt_client.publish("example_hipmi", data1);
|
||||
setData1("");
|
||||
}}
|
||||
>
|
||||
kirim
|
||||
</button>
|
||||
</Stack>
|
||||
<Stack align="center" justify="center">
|
||||
<TextInput
|
||||
label="User 2"
|
||||
value={data2}
|
||||
onChange={(val) => setData2(val.currentTarget.value)}
|
||||
/>
|
||||
<button
|
||||
onClick={() => {
|
||||
mqtt_client.publish("example_hipmi", data2);
|
||||
setData2("");
|
||||
}}
|
||||
>
|
||||
kirim
|
||||
</button>
|
||||
</Stack>
|
||||
</SimpleGrid>
|
||||
<Stack align="center" justify="center" mt={"xl"}>
|
||||
<Paper withBorder shadow="lg" p={"lg"}>
|
||||
{msg}
|
||||
</Paper>
|
||||
</Stack>
|
||||
{/* <ViewMakuro /> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
// return (
|
||||
// <>
|
||||
// <SimpleGrid cols={2} mt={"lg"}>
|
||||
// <Stack align="center" justify="center">
|
||||
// <TextInput
|
||||
// label="User 1"
|
||||
// value={data1}
|
||||
// onChange={(val) => setData1(val.currentTarget.value)}
|
||||
// />
|
||||
// <button
|
||||
// onClick={() => {
|
||||
// mqtt_client.publish("example_hipmi", data1);
|
||||
// setData1("");
|
||||
// }}
|
||||
// >
|
||||
// kirim
|
||||
// </button>
|
||||
// </Stack>
|
||||
// <Stack align="center" justify="center">
|
||||
// <TextInput
|
||||
// label="User 2"
|
||||
// value={data2}
|
||||
// onChange={(val) => setData2(val.currentTarget.value)}
|
||||
// />
|
||||
// <button
|
||||
// onClick={() => {
|
||||
// mqtt_client.publish("example_hipmi", data2);
|
||||
// setData2("");
|
||||
// }}
|
||||
// >
|
||||
// kirim
|
||||
// </button>
|
||||
// </Stack>
|
||||
// </SimpleGrid>
|
||||
// <Stack align="center" justify="center" mt={"xl"}>
|
||||
// <Paper withBorder shadow="lg" p={"lg"}>
|
||||
// {msg}
|
||||
// </Paper>
|
||||
// </Stack>
|
||||
// {/* <ViewMakuro /> */}
|
||||
// </>
|
||||
// );
|
||||
// }
|
||||
|
||||
@@ -14,8 +14,9 @@ export default function LayoutValidasi({
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
bg={"red"}
|
||||
header={
|
||||
<Header height={50} sx={{borderStyle: "none"}} px={"md"}>
|
||||
<Header height={50} sx={{borderStyle: "none"}} px={"md"} bg={"yellow"}>
|
||||
<Group h={50} align="center">
|
||||
<ActionIcon variant="transparent" onClick={() => router.back()} >
|
||||
<IconChevronLeft />
|
||||
|
||||
@@ -151,7 +151,7 @@ export default function Validasi({ dataOtp }: { dataOtp: any }) {
|
||||
|
||||
{/* <pre>{JSON.stringify(code)}</pre> */}
|
||||
|
||||
<Center h={"80%"}>
|
||||
<Center h={"80%"} bg={"blue"} >
|
||||
<Stack px={"lg"} spacing={"xl"} w={{ base: 400 }} justify="center">
|
||||
<Center>
|
||||
<IconCloudLockOpen size={130} />
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { MODEL_COLLABORATION } from "../../model/interface";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { RouterColab } from "@/app/lib/router_hipmi/router_colab";
|
||||
|
||||
export default async function colab_funCreateProyek(
|
||||
value: MODEL_COLLABORATION
|
||||
) {
|
||||
const AuthorId = await User_getUserId();
|
||||
const AuthorId = await user_getOneUserId();
|
||||
|
||||
const create = await prisma.projectCollaboration.create({
|
||||
data: {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function colab_funCekPartisipasiById(colabId: string) {
|
||||
const UserLoginId = await User_getUserId();
|
||||
const UserLoginId = await user_getOneUserId();
|
||||
|
||||
const cek = await prisma.projectCollaboration_Partisipasi.findFirst({
|
||||
where: {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function colab_getListByStatusId(statusId: number) {
|
||||
const AuthorId = await User_getUserId();
|
||||
const AuthorId = await user_getOneUserId();
|
||||
const data = await prisma.projectCollaboration.findMany({
|
||||
where: {
|
||||
userId: AuthorId,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function colab_getListPartisipasiByAuthorId() {
|
||||
const AuthorId = await User_getUserId();
|
||||
const AuthorId = await user_getOneUserId();
|
||||
|
||||
const get = await prisma.projectCollaboration_Partisipasi.findMany({
|
||||
where: {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function colab_getListAllProyekByAuthorId() {
|
||||
const AuthorId = await User_getUserId();
|
||||
const AuthorId = await user_getOneUserId();
|
||||
const get = await prisma.projectCollaboration.findMany({
|
||||
where: { userId: AuthorId, isActive: true },
|
||||
select: {
|
||||
|
||||
@@ -32,7 +32,7 @@ import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loadi
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_forum_loading_edit_posting } from "../../global_state";
|
||||
import ComponentForum_LoadingDrawer from "../loading_drawer";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { IconSquareCheck } from "@tabler/icons-react";
|
||||
|
||||
@@ -26,7 +26,7 @@ import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loadi
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_forum_loading_edit_posting } from "../../global_state";
|
||||
import ComponentForum_LoadingDrawer from "../loading_drawer";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { forum_funDeleteKomentarById } from "../../fun/delete/fun_delete_komentar_by_id";
|
||||
|
||||
@@ -33,7 +33,7 @@ import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loadi
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_forum_loading_edit_posting } from "../../global_state";
|
||||
import ComponentForum_LoadingDrawer from "../loading_drawer";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { forum_funDeletePostingById } from "../../fun/delete/fun_delete_posting_by_id";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { forum_funEditStatusPostingById } from "../../fun/edit/fun_edit_status_posting_by_id";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function forum_countPostingByAuthorId(authorId: string) {
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function forum_funCreate(value: string) {
|
||||
const AuthorId = await User_getUserId();
|
||||
const AuthorId = await user_getOneUserId();
|
||||
|
||||
const create = await prisma.forum_Posting.create({
|
||||
data: {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function forum_funCreateKomentar(
|
||||
postingId: string,
|
||||
komentar: string
|
||||
) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
|
||||
const create = await prisma.forum_Komentar.create({
|
||||
data: {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function forum_funCreateReportKomentar(
|
||||
komentarId: string,
|
||||
value: string
|
||||
) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
|
||||
const cekId = await prisma.forumMaster_KategoriReport.findFirst({
|
||||
where: {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function forum_funCreateReportKomentarLainnya(
|
||||
komentarId: string,
|
||||
deskripsi: string
|
||||
) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const create = await prisma.forum_ReportKomentar.create({
|
||||
data: {
|
||||
forum_KomentarId: komentarId,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function forum_funCreateReportPosting(
|
||||
postingId: string,
|
||||
value: string,
|
||||
) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const cekId = await prisma.forumMaster_KategoriReport.findFirst({
|
||||
where: {
|
||||
title: value,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function forum_funCreateReportPostingLainnya(
|
||||
postingId: string,
|
||||
deskripsi: string
|
||||
) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const create = await prisma.forum_ReportPosting.create({
|
||||
data: {
|
||||
forum_PostingId: postingId,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import _ from "lodash";
|
||||
|
||||
export async function forum_getListPostingByAuhtorId(authorId: string) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { redirect } from "next/navigation";
|
||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export async function User_getUserId() {
|
||||
export async function user_getOneUserId() {
|
||||
const c = cookies().get("ssn");
|
||||
if (!c?.value || c.value === "") return redirect(RouterAuth.login);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import _ from "lodash";
|
||||
import { v4 } from "uuid";
|
||||
import fs from "fs";
|
||||
@@ -9,7 +9,7 @@ import { revalidatePath } from "next/cache";
|
||||
import { MODEL_JOB } from "../../model/interface";
|
||||
|
||||
export async function Job_funCreate(req: MODEL_JOB, file: FormData) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
|
||||
const dataImage: any = file.get("file");
|
||||
if (dataImage !== "null") {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Job_getListAllArsipById() {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
|
||||
const get = await prisma.job.findMany({
|
||||
where: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Job_getAllListPublish() {
|
||||
const data = await prisma.job.findMany({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Job_getListStatusByStatusId(statusId: string) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
if (statusId === "1") {
|
||||
const data = await prisma.job.findMany({
|
||||
orderBy: {
|
||||
|
||||
@@ -31,6 +31,7 @@ import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.share
|
||||
import { NotifPeringatan } from "@/app_modules/donasi/component/notifikasi/notif_peringatan";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/notif_global/notifikasi_gagal";
|
||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/component_global/notif_global/notifikasi_peringatan";
|
||||
|
||||
export default function CreatePortofolio({
|
||||
bidangBisnis,
|
||||
@@ -40,6 +41,7 @@ export default function CreatePortofolio({
|
||||
profileId: any;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [value, setValue] = useState({
|
||||
namaBisnis: "",
|
||||
masterBidangBisnisId: "",
|
||||
@@ -145,10 +147,15 @@ export default function CreatePortofolio({
|
||||
const buffer = URL.createObjectURL(
|
||||
new Blob([new Uint8Array(await files.arrayBuffer())])
|
||||
);
|
||||
// console.log(buffer, "ini buffer");
|
||||
// console.log(files, " ini file");
|
||||
setImg(buffer);
|
||||
setFile(files);
|
||||
if (files.size > 2000000) {
|
||||
ComponentGlobal_NotifikasiPeringatan(
|
||||
"Maaf, Ukuran file terlalu besar, maximum 2mb",
|
||||
3000
|
||||
);
|
||||
} else {
|
||||
setImg(buffer);
|
||||
setFile(files);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -230,8 +237,10 @@ export default function CreatePortofolio({
|
||||
radius={50}
|
||||
bg={Warna.hijau_muda}
|
||||
color="green"
|
||||
loading={loading ? true : false}
|
||||
loaderPosition="center"
|
||||
onClick={() => {
|
||||
onSubmit(router, profileId, value as any, file, medsos);
|
||||
onSubmit(router, profileId, value as any, file, medsos, setLoading);
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
@@ -248,7 +257,8 @@ async function onSubmit(
|
||||
profileId: string,
|
||||
dataPorto: MODEL_PORTOFOLIO_OLD,
|
||||
file: FormData,
|
||||
dataMedsos: any
|
||||
dataMedsos: any,
|
||||
setLoading: any
|
||||
) {
|
||||
const porto = {
|
||||
namaBisnis: dataPorto.namaBisnis,
|
||||
@@ -257,15 +267,18 @@ async function onSubmit(
|
||||
tlpn: dataPorto.tlpn,
|
||||
deskripsi: dataPorto.deskripsi,
|
||||
};
|
||||
if (_.values(porto).includes("")) return toast("Lengkapi Data");
|
||||
if (!file) return NotifPeringatan("Lengkapi logo binnis");
|
||||
if (_.values(porto).includes(""))
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||
if (!file)
|
||||
return ComponentGlobal_NotifikasiPeringatan("Lengkapi logo binnis");
|
||||
|
||||
const gambar = new FormData
|
||||
gambar.append("file",file as any)
|
||||
const gambar = new FormData();
|
||||
gambar.append("file", file as any);
|
||||
|
||||
await funCreatePortofolio(profileId, porto as any, gambar, dataMedsos).then(
|
||||
(res) => {
|
||||
if (res.status === 201) {
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil("Berhasil disimpan");
|
||||
router.back();
|
||||
} else {
|
||||
|
||||
@@ -22,6 +22,7 @@ export default function Portofolio_EditDataBisnis({
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [porto, setPorto] = useState(dataPorto);
|
||||
const [loading, setLoading] = useState(false);
|
||||
// const [value, setPorto] = useState({
|
||||
// namaBisnis: "",
|
||||
// masterBidangBisnisId: "",
|
||||
@@ -107,8 +108,10 @@ export default function Portofolio_EditDataBisnis({
|
||||
</Stack>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
loading={loading ? true : false}
|
||||
loaderPosition="center"
|
||||
onClick={() => {
|
||||
onUpdate(router, porto as any);
|
||||
onUpdate(router, porto as any, setLoading);
|
||||
}}
|
||||
>
|
||||
Update
|
||||
@@ -118,9 +121,14 @@ export default function Portofolio_EditDataBisnis({
|
||||
);
|
||||
}
|
||||
|
||||
async function onUpdate(router: AppRouterInstance, data: MODEL_PORTOFOLIO) {
|
||||
async function onUpdate(
|
||||
router: AppRouterInstance,
|
||||
data: MODEL_PORTOFOLIO,
|
||||
setLoading: any
|
||||
) {
|
||||
await Portofolio_funEditDataBisnis(data).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.back();
|
||||
} else {
|
||||
|
||||
@@ -34,6 +34,7 @@ export default function Portofolio_EditLogoBisnis({
|
||||
const router = useRouter();
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [image, setImage] = useState<any | null>(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<Stack spacing={"xl"} px={"sm"}>
|
||||
@@ -83,12 +84,28 @@ export default function Portofolio_EditLogoBisnis({
|
||||
</Stack>
|
||||
</Paper>
|
||||
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() => onUpdate(router, dataPorto.id, file as any)}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
{file ? (
|
||||
<Button
|
||||
radius={"xl"}
|
||||
onClick={() =>
|
||||
onUpdate(router, dataPorto.id, file as any, setLoading)
|
||||
}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
disabled
|
||||
radius={"xl"}
|
||||
loading={loading ? true : false}
|
||||
loaderPosition="center"
|
||||
onClick={() =>
|
||||
onUpdate(router, dataPorto.id, file as any, setLoading)
|
||||
}
|
||||
>
|
||||
Simpan
|
||||
</Button>
|
||||
)}
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
@@ -97,13 +114,15 @@ export default function Portofolio_EditLogoBisnis({
|
||||
async function onUpdate(
|
||||
router: AppRouterInstance,
|
||||
portoId: string,
|
||||
file: FormData
|
||||
file: FormData,
|
||||
setLoading: any
|
||||
) {
|
||||
const gambar = new FormData();
|
||||
gambar.append("file", file as any);
|
||||
|
||||
await Portofolio_funEditLogoBisnisById(portoId, gambar).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.back();
|
||||
} else {
|
||||
|
||||
@@ -18,9 +18,11 @@ export default function Portofolio_EditMedsosBisnis({
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [medsos, setMedsos] = useState(dataMedsos);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<pre>{JSON.stringify(dataMedsos, null, 2)}</pre>
|
||||
{/* <pre>{JSON.stringify(dataMedsos, null, 2)}</pre> */}
|
||||
<Paper shadow="lg" p={"sm"}>
|
||||
<Stack px={"sm"}>
|
||||
<TextInput
|
||||
@@ -82,7 +84,9 @@ export default function Portofolio_EditMedsosBisnis({
|
||||
<Button
|
||||
mt={"xl"}
|
||||
radius={"xl"}
|
||||
onClick={() => onUpdate(router, medsos)}
|
||||
loading={loading ? true : false}
|
||||
loaderPosition="center"
|
||||
onClick={() => onUpdate(router, medsos, setLoading)}
|
||||
>
|
||||
Update
|
||||
</Button>
|
||||
@@ -94,10 +98,12 @@ export default function Portofolio_EditMedsosBisnis({
|
||||
|
||||
async function onUpdate(
|
||||
router: AppRouterInstance,
|
||||
medsos: MODEL_PORTOFOLIO_MEDSOS
|
||||
medsos: MODEL_PORTOFOLIO_MEDSOS,
|
||||
setLoading: any
|
||||
) {
|
||||
await Portofolio_funEditMedsosById(medsos).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setLoading(true);
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.back();
|
||||
} else {
|
||||
|
||||
@@ -4,8 +4,12 @@ import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function funGetListPortofolio(profileId: any) {
|
||||
const data = await prisma.portofolio.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc"
|
||||
},
|
||||
where: {
|
||||
profileId: profileId,
|
||||
active: true
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Portofolio_getOneById(portoId: string) {
|
||||
// console.log(id)
|
||||
export async function portofolio_getOneById(portoId: string) {
|
||||
// console.log(id)
|
||||
const data = await prisma.portofolio.findUnique({
|
||||
where: {
|
||||
id: portoId,
|
||||
@@ -27,12 +27,17 @@ export async function Portofolio_getOneById(portoId: string) {
|
||||
},
|
||||
},
|
||||
Portofolio_MediaSosial: true,
|
||||
|
||||
|
||||
|
||||
|
||||
Profile: {
|
||||
select: {
|
||||
User: {
|
||||
select: {
|
||||
id: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return data
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
Center,
|
||||
Grid,
|
||||
Group,
|
||||
Loader,
|
||||
Paper,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
@@ -40,6 +41,10 @@ export default function ListPortofolioView({
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [porto, setPorto] = useState(listPorto);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [loadingPorto, setLoadingPorto] = useState(false);
|
||||
const [idPorto, setIdPorto] = useState("")
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(porto, null, 2)}</pre> */}
|
||||
@@ -50,10 +55,12 @@ export default function ListPortofolioView({
|
||||
<Title order={4}>Portofolio</Title>
|
||||
{profile?.User.id === userLoginId ? (
|
||||
<ActionIcon
|
||||
loading={loading ? true : false}
|
||||
variant="transparent"
|
||||
onClick={() =>
|
||||
router.push(RouterPortofolio.create + `${profile.id}`)
|
||||
}
|
||||
onClick={() => {
|
||||
router.push(RouterPortofolio.create + `${profile.id}`);
|
||||
setLoading(true);
|
||||
}}
|
||||
>
|
||||
<IconPencilPlus color={Warna.biru} />
|
||||
</ActionIcon>
|
||||
@@ -70,42 +77,49 @@ export default function ListPortofolioView({
|
||||
</Center>
|
||||
) : (
|
||||
<SimpleGrid
|
||||
cols={4}
|
||||
spacing="md"
|
||||
breakpoints={[
|
||||
{ maxWidth: "md", cols: 3, spacing: "md" },
|
||||
{ maxWidth: "sm", cols: 2, spacing: "sm" },
|
||||
{ maxWidth: "xs", cols: 1, spacing: "sm" },
|
||||
]}
|
||||
>
|
||||
{porto.map((e: any) => (
|
||||
<Paper
|
||||
key={e.id}
|
||||
bg={"gray.5"}
|
||||
radius={"md"}
|
||||
onClick={() => router.push(`/dev/portofolio/main/${e.id}/`)}
|
||||
>
|
||||
<Grid align="center" p={"sm"}>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text fw={"bold"} truncate>
|
||||
{e.namaBisnis}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={2}>
|
||||
<Stack>
|
||||
<IconCaretRight color="black" size={35} />
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
cols={4}
|
||||
spacing="md"
|
||||
breakpoints={[
|
||||
{ maxWidth: "md", cols: 3, spacing: "md" },
|
||||
{ maxWidth: "sm", cols: 2, spacing: "sm" },
|
||||
{ maxWidth: "xs", cols: 1, spacing: "sm" },
|
||||
]}
|
||||
>
|
||||
{porto.map((e) => (
|
||||
<Paper
|
||||
shadow="md"
|
||||
key={e.id}
|
||||
bg={"gray.5"}
|
||||
radius={"md"}
|
||||
onClick={() => {
|
||||
setIdPorto(e.id)
|
||||
setLoadingPorto(true);
|
||||
router.push(`/dev/portofolio/main/${e.id}/`);
|
||||
}}
|
||||
>
|
||||
<Grid align="center" p={"sm"}>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text fw={"bold"} lineClamp={1}>
|
||||
{e.namaBisnis}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"content"}>
|
||||
<Stack>
|
||||
{idPorto === e.id && loadingPorto ? (
|
||||
<Loader color="gray" size={25}/>
|
||||
) : (
|
||||
<IconCaretRight color="black" size={25} />
|
||||
)}
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
)}
|
||||
</Box>
|
||||
</Stack>
|
||||
</Paper>
|
||||
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -18,16 +18,25 @@ import ComponentKatalog_HeaderTamplate from "../../component/header_tamplate";
|
||||
import { title } from "process";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function PortofolioLayout({
|
||||
children,
|
||||
portoId,
|
||||
userLoginId,
|
||||
authorId,
|
||||
}: {
|
||||
children: any;
|
||||
portoId: any;
|
||||
userLoginId: string;
|
||||
authorId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [loadingData, setLoadingData] = useState(false);
|
||||
const [loadingLogo, setLoadingLogo] = useState(false);
|
||||
const [loadingMedia, setLoadingMedia] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppShell
|
||||
@@ -43,9 +52,13 @@ export default function PortofolioLayout({
|
||||
<IconChevronLeft />
|
||||
</ActionIcon>
|
||||
<Title order={5}>Detail Portofolio</Title>
|
||||
<ActionIcon variant="transparent" onClick={() => open()}>
|
||||
<IconEdit />
|
||||
</ActionIcon>
|
||||
{userLoginId === authorId ? (
|
||||
<ActionIcon variant="transparent" onClick={() => open()}>
|
||||
<IconEdit />
|
||||
</ActionIcon>
|
||||
) : (
|
||||
<ActionIcon disabled variant="transparent"></ActionIcon>
|
||||
)}
|
||||
</Group>
|
||||
</Header>
|
||||
}
|
||||
@@ -56,7 +69,10 @@ export default function PortofolioLayout({
|
||||
<Button
|
||||
radius={"xl"}
|
||||
variant="outline"
|
||||
loaderPosition="center"
|
||||
loading={loadingData ? true : false}
|
||||
onClick={() => {
|
||||
setLoadingData(true);
|
||||
router.push(RouterPortofolio.edit_data_bisnis + `${portoId}`);
|
||||
}}
|
||||
>
|
||||
@@ -66,7 +82,10 @@ export default function PortofolioLayout({
|
||||
radius={"xl"}
|
||||
variant="outline"
|
||||
color="green"
|
||||
loaderPosition="center"
|
||||
loading={loadingLogo ? true : false}
|
||||
onClick={() => {
|
||||
setLoadingLogo(true);
|
||||
router.push(RouterPortofolio.edit_logo_bisnis + `${portoId}`);
|
||||
}}
|
||||
>
|
||||
@@ -76,7 +95,10 @@ export default function PortofolioLayout({
|
||||
radius={"xl"}
|
||||
variant="outline"
|
||||
color="orange"
|
||||
loaderPosition="center"
|
||||
loading={loadingMedia ? true : false}
|
||||
onClick={() => {
|
||||
setLoadingMedia(true);
|
||||
router.push(RouterPortofolio.edit_medsos_bisnis + `${portoId}`);
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -39,7 +39,7 @@ import { redirect, useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_PORTOFOLIO } from "../model/interface";
|
||||
import { useDisclosure, useShallowEffect } from "@mantine/hooks";
|
||||
import { Portofolio_getOneById } from "../fun/get/get_one_portofolio";
|
||||
import { portofolio_getOneById } from "../fun/get/get_one_portofolio";
|
||||
import _ from "lodash";
|
||||
import { Portofolio_funDeletePortofolioById } from "../fun/delete/fun_delete_by_id";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/component_global/notif_global/notifikasi_berhasil";
|
||||
@@ -48,12 +48,15 @@ import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/component_global/
|
||||
|
||||
export default function ViewPortofolio({
|
||||
dataPorto,
|
||||
userLoginId,
|
||||
}: {
|
||||
dataPorto: MODEL_PORTOFOLIO;
|
||||
userLoginId: string;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [porto, setPorto] = useState(dataPorto);
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
const [loadingDel, setLoadingDel] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -67,7 +70,7 @@ export default function ViewPortofolio({
|
||||
<IconBuildingSkyscraper />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text truncate>{dataPorto.namaBisnis}</Text>
|
||||
<Text>{dataPorto?.namaBisnis}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid>
|
||||
@@ -75,7 +78,7 @@ export default function ViewPortofolio({
|
||||
<IconPhoneCall />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text>+{dataPorto.tlpn}</Text>
|
||||
<Text>+{dataPorto?.tlpn}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid>
|
||||
@@ -83,7 +86,7 @@ export default function ViewPortofolio({
|
||||
<IconMapPin />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text>{dataPorto.alamatKantor}</Text>
|
||||
<Text>{dataPorto?.alamatKantor}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid>
|
||||
@@ -91,7 +94,7 @@ export default function ViewPortofolio({
|
||||
<IconListDetails />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text>{dataPorto.MasterBidangBisnis.name}</Text>
|
||||
<Text>{dataPorto?.MasterBidangBisnis.name}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Grid>
|
||||
@@ -99,7 +102,7 @@ export default function ViewPortofolio({
|
||||
<IconPinned />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
<Text>{dataPorto.deskripsi}</Text>
|
||||
<Text>{dataPorto?.deskripsi}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Stack>
|
||||
@@ -111,7 +114,7 @@ export default function ViewPortofolio({
|
||||
<Paper>
|
||||
<Image
|
||||
alt="Foto"
|
||||
src={RouterPortofolio.api_logo_porto + `${dataPorto.logoId}`}
|
||||
src={RouterPortofolio.api_logo_porto + `${dataPorto?.logoId}`}
|
||||
/>
|
||||
</Paper>
|
||||
</AspectRatio>
|
||||
@@ -125,8 +128,8 @@ export default function ViewPortofolio({
|
||||
<IconBrandFacebook />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
{dataPorto.Portofolio_MediaSosial.facebook ? (
|
||||
<Text>{dataPorto.Portofolio_MediaSosial.facebook}</Text>
|
||||
{dataPorto?.Portofolio_MediaSosial.facebook ? (
|
||||
<Text>{dataPorto?.Portofolio_MediaSosial.facebook}</Text>
|
||||
) : (
|
||||
"-"
|
||||
)}
|
||||
@@ -137,8 +140,8 @@ export default function ViewPortofolio({
|
||||
<IconBrandInstagram />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
{dataPorto.Portofolio_MediaSosial.instagram ? (
|
||||
<Text>{dataPorto.Portofolio_MediaSosial.instagram}</Text>
|
||||
{dataPorto?.Portofolio_MediaSosial.instagram ? (
|
||||
<Text>{dataPorto?.Portofolio_MediaSosial.instagram}</Text>
|
||||
) : (
|
||||
"-"
|
||||
)}
|
||||
@@ -149,8 +152,8 @@ export default function ViewPortofolio({
|
||||
<IconBrandTiktok />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
{dataPorto.Portofolio_MediaSosial.tiktok ? (
|
||||
<Text>{dataPorto.Portofolio_MediaSosial.tiktok}</Text>
|
||||
{dataPorto?.Portofolio_MediaSosial.tiktok ? (
|
||||
<Text>{dataPorto?.Portofolio_MediaSosial.tiktok}</Text>
|
||||
) : (
|
||||
"-"
|
||||
)}
|
||||
@@ -161,8 +164,8 @@ export default function ViewPortofolio({
|
||||
<IconBrandTwitter />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
{dataPorto.Portofolio_MediaSosial.twitter ? (
|
||||
<Text>{dataPorto.Portofolio_MediaSosial.twitter}</Text>
|
||||
{dataPorto?.Portofolio_MediaSosial.twitter ? (
|
||||
<Text>{dataPorto?.Portofolio_MediaSosial.twitter}</Text>
|
||||
) : (
|
||||
"-"
|
||||
)}
|
||||
@@ -173,8 +176,8 @@ export default function ViewPortofolio({
|
||||
<IconBrandYoutube />
|
||||
</Grid.Col>
|
||||
<Grid.Col span={"auto"}>
|
||||
{dataPorto.Portofolio_MediaSosial.youtube ? (
|
||||
<Text>{dataPorto.Portofolio_MediaSosial.youtube}</Text>
|
||||
{dataPorto?.Portofolio_MediaSosial.youtube ? (
|
||||
<Text>{dataPorto?.Portofolio_MediaSosial.youtube}</Text>
|
||||
) : (
|
||||
"-"
|
||||
)}
|
||||
@@ -204,7 +207,9 @@ export default function ViewPortofolio({
|
||||
<Button
|
||||
radius={"xl"}
|
||||
color="red"
|
||||
onClick={() => onDelete(router, dataPorto as any)}
|
||||
loaderPosition="center"
|
||||
loading={loadingDel ? true : false}
|
||||
onClick={() => onDelete(router, dataPorto as any, setLoadingDel)}
|
||||
>
|
||||
Hapus
|
||||
</Button>
|
||||
@@ -217,10 +222,12 @@ export default function ViewPortofolio({
|
||||
|
||||
async function onDelete(
|
||||
router: AppRouterInstance,
|
||||
dataPorto: MODEL_PORTOFOLIO
|
||||
dataPorto: MODEL_PORTOFOLIO,
|
||||
setLoadingDel: any
|
||||
) {
|
||||
await Portofolio_funDeletePortofolioById(dataPorto).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setLoadingDel(true)
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.push(RouterProfile.katalog + `${dataPorto.profileId}`);
|
||||
} else {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Vote_funCreateHasil(
|
||||
pilihanVotingId: string,
|
||||
votingId: string
|
||||
) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
|
||||
const get = await prisma.voting_DaftarNamaVote.findFirst({
|
||||
where: {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Vote_funCreatePilihanVotingById(
|
||||
namaVotingId: string,
|
||||
votingId: string
|
||||
) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
|
||||
const create = await prisma.voting_Kontributor.create({
|
||||
data: {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
"use server";
|
||||
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { MODEL_VOTING } from "../../model/interface";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Vote_funCreate(req: MODEL_VOTING, listVote: any[]) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
|
||||
const create = await prisma.voting.create({
|
||||
data: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export async function Vote_funEditStatusByStatusId(
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_cekKontributorById(votingId: string) {
|
||||
const UserId = await User_getUserId()
|
||||
const UserId = await user_getOneUserId()
|
||||
|
||||
const cek = await prisma.voting_Kontributor.count({
|
||||
where: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_getAllListPublish() {
|
||||
const data = await prisma.voting.findMany({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
|
||||
export async function Vote_getAllListRiwayatSaya() {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const data = await prisma.voting.findMany({
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_getAllListKontribusiByAuthorId() {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
const data = await prisma.voting_Kontributor.findMany({
|
||||
orderBy: {
|
||||
createdAt: "asc",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_getListByStatusId(statusId: string) {
|
||||
const authorId = await User_getUserId();
|
||||
const authorId = await user_getOneUserId();
|
||||
|
||||
if (statusId === "1") {
|
||||
const data = await prisma.voting.findMany({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"use server";
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { user_getOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export async function Vote_getOnePilihanVotingByUserId(votingId: string) {
|
||||
const userId = await User_getUserId();
|
||||
const userId = await user_getOneUserId();
|
||||
const get = await prisma.voting_Kontributor.findFirst({
|
||||
where: {
|
||||
authorId: userId,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import mqtt from "mqtt";
|
||||
|
||||
declare global {
|
||||
var mqtt_client: mqtt.MqttClient;
|
||||
}
|
||||
// declare global {
|
||||
// var mqtt_client: mqtt.MqttClient;
|
||||
// }
|
||||
|
||||
const mqtt_client =
|
||||
globalThis.mqtt_client || mqtt.connect("wss://io.wibudev.com");
|
||||
// const mqtt_client =
|
||||
// globalThis.mqtt_client || mqtt.connect("wss://io.wibudev.com");
|
||||
|
||||
export default mqtt_client;
|
||||
// export default mqtt_client;
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import mqtt_client from "./mqtt_client";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_coba_chat } from "@/app/makuro/gs_coba";
|
||||
// import mqtt_client from "./mqtt_client";
|
||||
// import { useAtom } from "jotai";
|
||||
// import { gs_coba_chat } from "@/app/makuro/gs_coba";
|
||||
|
||||
export default function MqttLoader() {
|
||||
const [msg, setMsg] = useAtom(gs_coba_chat);
|
||||
useEffect(() => {
|
||||
mqtt_client.on("connect", () => {
|
||||
console.log("connected");
|
||||
mqtt_client.subscribe("example_hipmi");
|
||||
});
|
||||
// export default function MqttLoader() {
|
||||
// const [msg, setMsg] = useAtom(gs_coba_chat);
|
||||
// useEffect(() => {
|
||||
// mqtt_client.on("connect", () => {
|
||||
// console.log("connected");
|
||||
// mqtt_client.subscribe("example_hipmi");
|
||||
// });
|
||||
|
||||
mqtt_client.on("message", (apa, message) => {
|
||||
console.log(message.toLocaleString());
|
||||
setMsg(message.toLocaleString() as any);
|
||||
});
|
||||
}, [setMsg]);
|
||||
return null;
|
||||
}
|
||||
// mqtt_client.on("message", (apa, message) => {
|
||||
// console.log(message.toLocaleString());
|
||||
// setMsg(message.toLocaleString() as any);
|
||||
// });
|
||||
// }, [setMsg]);
|
||||
// return null;
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user