create correct down migration for delete_event_trigger action (close #1390) (#1391)

This commit is contained in:
Aravind Shankar 2019-01-24 09:40:49 +05:30 committed by Shahidh K Muhammed
parent 46fdfc998f
commit b5b2fe6851

View File

@ -451,9 +451,7 @@ const makeMigrationCall = (
const deleteTrigger = triggerName => {
return (dispatch, getState) => {
dispatch(showSuccessNotification('Deleting Trigger...'));
const triggerList = getState().triggers.triggerList;
const currentTriggerInfo = triggerList.filter(
const currentTriggerInfo = getState().triggers.triggerList.filter(
t => t.name === triggerName
)[0];
// apply migrations
@ -472,9 +470,17 @@ const deleteTrigger = triggerName => {
name: currentTriggerInfo.table_name,
schema: currentTriggerInfo.schema_name,
},
webhook: currentTriggerInfo.webhook,
retry_conf: { ...currentTriggerInfo.configuration.retry_conf },
...currentTriggerInfo.configuration.definition,
headers: [...currentTriggerInfo.configuration.headers],
},
};
if (currentTriggerInfo.configuration.webhook_from_env) {
downPayload.args.webhook_from_env =
currentTriggerInfo.configuration.webhook_from_env;
} else {
downPayload.args.webhook = currentTriggerInfo.configuration.webhook;
}
const upQueryArgs = [];
upQueryArgs.push(payload);
const downQueryArgs = [];
@ -494,7 +500,8 @@ const deleteTrigger = triggerName => {
const customOnSuccess = () => {
// dispatch({ type: REQUEST_SUCCESS });
dispatch({ type: REQUEST_COMPLETE }); // modify trigger action
dispatch(loadTriggers()).then(() => dispatch(push('/manage/triggers')));
dispatch(showSuccessNotification('Trigger Deleted'));
dispatch(push('/manage/triggers')).then(() => dispatch(loadTriggers()));
return;
};
const customOnError = () => {