Files
hipmi/src/app/dev/investasi/proses_transaksi/[id]/page.tsx
Bagasbanuna02 693bb65710 Alur Payment
# feat
- Pembelian saham
- Function progres
### No Issue
2023-12-12 13:56:39 +08:00

30 lines
962 B
TypeScript

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/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 dataInvestasi = await getOneInvestasiById(params.id);
// console.log(userLogin);
return (
<>
<ProsesTransaksiInvestasi
dataInvestasi={dataInvestasi as any}
userLogin={userLogin as any}
/>
</>
);
}