Skip to content

Commit

Permalink
update list on save
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshamoon committed Oct 11, 2023
1 parent e667866 commit c709199
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/containers/Collection/CollectionList/CollectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const columnAttributes = {
};

export const CollectionList = () => {
const [updateCollection, setUpdateCollection] = useState(false);
const [addContactsDialogShow, setAddContactsDialogShow] = useState(false);

const [contactSearchTerm, setContactSearchTerm] = useState('');
Expand Down Expand Up @@ -95,6 +96,7 @@ export const CollectionList = () => {
} else {
setNotification(`${numberAdded} contact${numberAdded === 1 ? '' : 's were'} added`);
}
setUpdateCollection((updateCollection) => !updateCollection);

Check warning on line 99 in src/containers/Collection/CollectionList/CollectionList.tsx

View check run for this annotation

Codecov / codecov/patch

src/containers/Collection/CollectionList/CollectionList.tsx#L99

Added line #L99 was not covered by tests
setAddContactsDialogShow(false);
},
refetchQueries: [{ query: GET_COLLECTION_CONTACTS, variables: { id: collectionId } }],
Expand Down Expand Up @@ -218,6 +220,7 @@ export const CollectionList = () => {
</Modal>
)}
<List
refreshList={updateCollection}
restrictedAction={getRestrictedAction}
title={t('Collections')}
listItem="groups"
Expand Down
1 change: 0 additions & 1 deletion src/containers/Flow/FlowList/FlowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ export const FlowList = () => {
secondaryButton={importButton}
filters={filters}
filterList={activeFilter}
filtersTag={selectedtag && selectedtag.id}
filterDropdowm={tagFilter}
/>
);
Expand Down
6 changes: 3 additions & 3 deletions src/containers/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export interface ListProps {
};
searchParameter?: Array<any>;
filters?: Object | null;
filtersTag?: any;
filterList?: any;
filterDropdowm?: any;
displayListType?: string;
Expand Down Expand Up @@ -82,6 +81,7 @@ export interface ListProps {
defaultSortBy?: string | null;
noItemText?: string | null;
customStyles?: any;
refreshList?: boolean;
}

interface TableVals {
Expand Down Expand Up @@ -116,7 +116,7 @@ export const List = ({
editSupport = true,
searchParameter = ['label'],
filters = null,
filtersTag = null,
refreshList = false,
displayListType = 'list',
cardLink = null,
additionalAction = () => [],
Expand Down Expand Up @@ -268,7 +268,7 @@ export const List = ({
useEffect(() => {
refetchValues();
refetchCount();
}, [searchVal, filters]);
}, [searchVal, filters, refreshList]);

useEffect(() => {
if (userRole.length === 0) {
Expand Down

0 comments on commit c709199

Please sign in to comment.