Test server
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
|
||||
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Center,
|
||||
Group,
|
||||
Pagination,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
@@ -16,14 +16,11 @@ import {
|
||||
Table,
|
||||
Text,
|
||||
TextInput,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { IconEyeCheck, IconSearch } from "@tabler/icons-react";
|
||||
import { IconPhotoCheck, IconSearch } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import adminJob_getListPublish from "../../fun/get/get_list_publish";
|
||||
import { IconPhotoCheck } from "@tabler/icons-react";
|
||||
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
|
||||
|
||||
export default function AdminJob_TablePublish({
|
||||
dataPublish,
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
"use server";
|
||||
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { sealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export async function Auth_funRegister(data: any) {
|
||||
|
||||
const cekUsername = await prisma.user.findUnique({
|
||||
where: {
|
||||
username: data.username,
|
||||
@@ -35,7 +34,7 @@ export async function Auth_funRegister(data: any) {
|
||||
username: create.username,
|
||||
}),
|
||||
{
|
||||
password: await config.server.password,
|
||||
password: PwdCookies
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { sealData } from "iron-session";
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
import { cookies } from "next/headers";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
|
||||
|
||||
export async function auth_funValidasi(nomor: string) {
|
||||
const cek = await prisma.user.findUnique({
|
||||
@@ -30,7 +29,7 @@ export async function auth_funValidasi(nomor: string) {
|
||||
username: cek.username,
|
||||
}),
|
||||
{
|
||||
password: await config.server.password,
|
||||
password: PwdCookies,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
Center,
|
||||
Stack,
|
||||
Text,
|
||||
Title
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useFocusTrap } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
@@ -56,22 +56,6 @@ export default function Login() {
|
||||
// },
|
||||
// body: JSON.stringify(body),
|
||||
// })
|
||||
// .then((res) => res.json())
|
||||
// .then((val) => {
|
||||
// // console.log(val);
|
||||
// if (val.success === true) {
|
||||
// router.push(RouterAdminDashboard.splash_admin);
|
||||
// } else {
|
||||
// if (val.status == 200) {
|
||||
// setCode(val.body.otp);
|
||||
// setInputNumber(val.body.nomor);
|
||||
// router.push("/dev/auth/validasi");
|
||||
// return NotifBerhasil("Nomor OTP terkirim");
|
||||
// } else {
|
||||
// NotifGagal(val.message);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"use server";
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
import yaml from "yaml";
|
||||
import fs from "fs";
|
||||
import { unsealData } from "iron-session";
|
||||
import { redirect } from "next/navigation";
|
||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||
import _ from "lodash";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
|
||||
|
||||
export async function user_funGetOneUserId() {
|
||||
const kukis = cookies();
|
||||
@@ -17,7 +16,7 @@ export async function user_funGetOneUserId() {
|
||||
|
||||
const token = JSON.parse(
|
||||
await unsealData(c?.value as string, {
|
||||
password: config.server.password,
|
||||
password: PwdCookies,
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -39,12 +39,10 @@ import { funCreateInvestasi } from "../fun/fun_create_investasi";
|
||||
import { gs_investas_menu, gs_investasi_status } from "../g_state";
|
||||
|
||||
export default function InvestasiCreate({
|
||||
id,
|
||||
pencarianInvestor,
|
||||
periodeDeviden,
|
||||
pembagianDeviden,
|
||||
}: {
|
||||
id: string;
|
||||
pencarianInvestor: MODEL_DEFAULT_MASTER_OLD[];
|
||||
periodeDeviden: MODEL_DEFAULT_MASTER_OLD[];
|
||||
pembagianDeviden: MODEL_DEFAULT_MASTER_OLD[];
|
||||
@@ -74,7 +72,6 @@ export default function InvestasiCreate({
|
||||
|
||||
async function onSubmit() {
|
||||
const body = {
|
||||
authorId: id,
|
||||
title: value.title,
|
||||
targetDana: value.targetDana,
|
||||
hargaLembar: value.hargaLembar,
|
||||
|
||||
@@ -8,12 +8,14 @@ import { revalidatePath } from "next/cache";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||
import funUploadProspektusInvestasi from "./fun_upload_prospek";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
||||
|
||||
export async function funCreateInvestasi(
|
||||
fileGambar: FormData,
|
||||
filePdf: FormData,
|
||||
data: MODEL_INVESTASI
|
||||
) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
// Function upload gambar
|
||||
const gambar: any = fileGambar.get("file");
|
||||
const gambarName = gambar.name;
|
||||
@@ -42,7 +44,7 @@ export async function funCreateInvestasi(
|
||||
|
||||
const createInvest = await prisma.investasi.create({
|
||||
data: {
|
||||
authorId: data.authorId,
|
||||
authorId: authorId,
|
||||
title: _.startCase(data.title),
|
||||
targetDana: data.targetDana.toString(),
|
||||
hargaLembar: data.hargaLembar.toString(),
|
||||
|
||||
Reference in New Issue
Block a user