diff --git a/src/containers/Flow/FlowList/FlowList.tsx b/src/containers/Flow/FlowList/FlowList.tsx index 4e40a75e0..5da3cc6ce 100644 --- a/src/containers/Flow/FlowList/FlowList.tsx +++ b/src/containers/Flow/FlowList/FlowList.tsx @@ -91,16 +91,10 @@ export const FlowList = () => { const [importFlow] = useMutation(IMPORT_FLOW, { onCompleted: (result: any) => { - const { success } = result.importFlow; - if (!success) { - setNotification( - t( - 'Sorry! An error occurred! This could happen if the flow is already present or error in the import file.' - ), - 'error' - ); - } else { - setNotification(t('The flow has been imported successfully.')); + const { status } = result.importFlow; + if (status) { + const statusValue = status.map((stat: any) => `${stat.flowName}: ${stat.status}`); + setNotification(t(statusValue.join('\n'))); } setImporting(false); }, diff --git a/src/graphql/mutations/Flow.ts b/src/graphql/mutations/Flow.ts index b7de918c7..087293ce9 100644 --- a/src/graphql/mutations/Flow.ts +++ b/src/graphql/mutations/Flow.ts @@ -107,10 +107,9 @@ export const CREATE_FLOW_COPY = gql` export const IMPORT_FLOW = gql` mutation importFlow($flow: Json!) { importFlow(flow: $flow) { - success - errors { - key - message + status { + flowName + status } } }