Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aatbip committed Feb 5, 2024
1 parent ef9cfdc commit 3a5e5b0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/app/manage/views/ManagePageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ export const ManagePageContainer = ({

const [allowedCustomField, setAllowedCustomField] = useState<any>(null);

const customFieldsValue: any | null = client.customFields;
const [customFieldsValue, setCustomFieldsValue] = useState<any>(client.customFields);

const [profileData, setProfileData] = useState<any>({});

const [originalProfileData, setOriginalProfileData] = useState<any>({});

useMemo(() => {
if (customFieldAccess.length > 0) {
const allowedFields = customFieldAccess.filter((field: any) => field.permission?.length > 0);
if (_customFieldAccess.length > 0) {
const allowedFields = _customFieldAccess.filter((field: any) => field.permission?.length > 0);
console.log(allowedFields);
const getSelectedValuesForMultiSelect = (key: string) => {
const values = customFieldsValue[key];
if (!values) {
Expand Down Expand Up @@ -95,6 +96,12 @@ export const ManagePageContainer = ({

const { data } = await res.json();

const client = await fetch(`/api/client?clientId=${clientId}&token=${token}`);

const updatedClientData = await client.json();

setCustomFieldsValue(updatedClientData.data.customFields);

setCustomFieldAccess(data);

setLoading(false);
Expand Down

0 comments on commit 3a5e5b0

Please sign in to comment.