fix: use client-side tRPC for InvestorDetails in modal context
InvestorDetails was using server-only tRPC import inside a "use client" modal, causing webpack build failure. Switch to React Query-based client API.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { api } from "@/trpc/server";
|
||||
"use client";
|
||||
|
||||
import { api } from "@/trpc/react";
|
||||
import { InvestorDetailsForm } from "./form";
|
||||
export { type TFormSchema } from "./form";
|
||||
|
||||
export async function InvestorDetails() {
|
||||
const stakeholders = await api.stakeholder.getStakeholders.query();
|
||||
return <InvestorDetailsForm stakeholders={stakeholders} />;
|
||||
export function InvestorDetails() {
|
||||
const { data: stakeholders } = api.stakeholder.getStakeholders.useQuery();
|
||||
return <InvestorDetailsForm stakeholders={stakeholders ?? []} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user