Skip to content

Commit

Permalink
Merge pull request #2924 from glific/enhancement/export-flow
Browse files Browse the repository at this point in the history
Added error message for export flow
  • Loading branch information
kurund authored Jun 11, 2024
2 parents 7595da6 + 5f9da25 commit f51987e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/components/floweditor/FlowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Button } from 'components/UI/Form/Button/Button';
import { APP_NAME } from 'config/index';
import { Simulator } from 'components/simulator/Simulator';
import { DialogBox } from 'components/UI/DialogBox/DialogBox';
import { setNotification } from 'common/notification';
import { setErrorMessage, setNotification } from 'common/notification';
import { PUBLISH_FLOW, RESET_FLOW_COUNT } from 'graphql/mutations/Flow';
import { EXPORT_FLOW, GET_FLOW_DETAILS, GET_FREE_FLOW } from 'graphql/queries/Flow';
import { getOrganizationServices, setAuthHeaders } from 'services/AuthService';
Expand Down Expand Up @@ -94,6 +94,9 @@ export const FlowEditor = () => {
const { exportData } = exportFlow;
exportFlowMethod(exportData, flowTitle);
},
onError: (error) => {
setErrorMessage(error);
},
});
const [resetFlowCountMethod] = useMutation(RESET_FLOW_COUNT, {
onCompleted: ({ resetFlowCount }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Flow/FlowList/FlowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { GET_TAGS } from 'graphql/queries/Tags';
import { AutoComplete } from 'components/UI/Form/AutoComplete/AutoComplete';
import { flowInfo } from 'common/HelpData';
import { DialogBox } from 'components/UI/DialogBox/DialogBox';
import { setNotification } from 'common/notification';
import { setErrorMessage, setNotification } from 'common/notification';

const getName = (text: string, keywordsList: any, roles: any) => {
const keywords = keywordsList.map((keyword: any) => keyword);
Expand Down Expand Up @@ -114,7 +114,7 @@ export const FlowList = () => {
setNotification('Flow exported successfully');
},
onError: (error: any) => {
setNotification('An error occured while exporting the flow', 'warning');
setErrorMessage(error);
},
});

Expand Down

0 comments on commit f51987e

Please sign in to comment.