Test server

This commit is contained in:
2024-09-17 08:51:27 +08:00
parent 2fef481e2f
commit 2ccbca6566
21 changed files with 51 additions and 137 deletions

View File

@@ -1,21 +1,11 @@
import { user_funGetOneUserId } from "@/app_modules/fun_global";
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
import { ProsesTransaksiInvestasi } from "@/app_modules/investasi";
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
import { unsealData } from "iron-session";
import { cookies } from "next/headers";
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
import yaml from "yaml";
import fs from "fs";
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
export default async function Page({ params }: { params: { id: string } }) {
const c = cookies().get("ssn");
const user = JSON.parse(
await unsealData(c?.value as string, {
password: config.server.password,
})
);
const userLogin = await funGetUserProfile(user.id);
const authorId = await user_funGetOneUserId();
const userLogin = await funGetUserProfile(authorId);
const dataInvestasi = await getOneInvestasiById(params.id);
// console.log(dataInvestasi);