Skip to content

Commit

Permalink
data plotting of table
Browse files Browse the repository at this point in the history
  • Loading branch information
aatbip committed Jan 31, 2024
1 parent 0bf24d9 commit de90790
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export class ClientProfileUpdatesService {
private prismaClient: PrismaClient = DBClient.getInstance();

async save(requestData: ClientProfileUpdates): Promise<void> {
//@ts-expect-error prisma generate unexpected error
await this.prismaClient.clientProtileUpdates.create({
data: {
clientId: requestData.clientId,
Expand Down
22 changes: 21 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import MainSection from './views/MainSection';
import { SidebarDecider } from '@/hoc/SidebarDecider';
import { apiUrl } from '@/config';
import { ParsedClientProfileUpdatesResponse } from '@/types/clientProfileUpdates';
import { CustomFieldAccessResponse } from '@/types/customFieldAccess';

export const revalidate = 0;

Expand All @@ -17,7 +18,25 @@ async function getClientProfileUpdates({
const res = await fetch(`${apiUrl}/api/client-profile-updates?token=${token}&portalId=${portalId}`);

if (!res.ok) {
throw new Error('Something went wrong while in getClientProfileUpdates');
throw new Error('Something went wrong in getClientProfileUpdates');
}

const data = await res.json();

return data;
}

async function getCustomFieldAccess({
token,
portalId,
}: {
token: string;
portalId: string;
}): Promise<CustomFieldAccessResponse> {
const res = await fetch(`${apiUrl}/api/custom-field-access?token=${token}&portalId=${portalId}`);

if (!res.ok) {
throw new Error('Something went wrong in getCustomFieldAccess');
}

const data = await res.json();
Expand All @@ -29,6 +48,7 @@ export default async function Home({ searchParams }: { searchParams: { token: st
const { token, portalId } = searchParams;

const clientProfileUpdates = await getClientProfileUpdates({ token, portalId });
const customFieldAccess = await getCustomFieldAccess({ token, portalId });

return (
<Stack direction="row">
Expand Down

0 comments on commit de90790

Please sign in to comment.