Skip to content

Commit

Permalink
added token and portalId
Browse files Browse the repository at this point in the history
  • Loading branch information
aatbip committed Feb 8, 2024
1 parent 8ebda6a commit abb68f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<ToggleDecider>
{children}
<Footer
handleSave={async (customFieldAccessPayload, settingsPayload) => {
handleSave={async (customFieldAccessPayload, settingsPayload, token, portalId) => {
'use server';
await fetch(`${apiUrl}/api/custom-field-access`, {
await fetch(`${apiUrl}/api/custom-field-access?token=${token}&portalId=${portalId}`, {
method: 'PUT',
body: JSON.stringify(customFieldAccessPayload),
});
await fetch(`${apiUrl}/api/settings`, {
await fetch(`${apiUrl}/api/settings?token=${token}&portalId=${portalId}`, {
method: 'PUT',
body: JSON.stringify(settingsPayload),
});
Expand Down
4 changes: 4 additions & 0 deletions src/layouts/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ interface Prop {
handleSave(
customFieldAccessPayload: { token: string; portalId: string; accesses: any },
settingsPayload: { token: string; portalId: string; profileLinks: any },
token: string,
portalId: string,
): Promise<void>;
}

Expand Down Expand Up @@ -39,6 +41,8 @@ export const Footer = ({ handleSave }: Prop) => {
portalId: appState?.portalId as string,
profileLinks: appState?.mutableSettings,
},
appState?.token as string,
appState?.portalId as string,
);
} finally {
setLoading(false);
Expand Down

0 comments on commit abb68f7

Please sign in to comment.