message: Chnages to remove trigger action links in app json when action is deleted.
diff: import pick from 'lodash/pick';
  import defaults from 'lodash/defaults';
  import defaultsDeep from 'lodash/defaultsDeep';
  -
  +import isEmpty from 'lodash/isEmpty';
  import { apps as appsDb, dbUtils } from '../../common/db';
  import { ErrorManager, ERROR_TYPES } from '../../common/errors';
  import { Validator } from './validator';
  import { getProfileType } from '../../common/utils/profile';
  import { FLOGO_PROFILE_TYPES } from '../../common/constants';
  +import mapKeys from "lodash/mapKeys";
  const EDITABLE_FIELDS = [
  'settings',
  @@ -113,13 +114,16 @@ export class HandlersManager {
  if (!app) {
  return null;
  }
  -
  - const triggerIndex = app.triggers.findIndex(t => t.handlers.findIndex(h => h.actionId === actionId) >= 0);
  - if (triggerIndex >= 0) {
  + const pull = app.triggers.reduce((result, trigger, index) => {
  + const existingHandlers = trigger.handlers.findIndex(handler => handler.actionId === actionId);
  + if (existingHandlers >= 0) {
  + result['triggers.' + index + '.handlers'] = {actionId: actionId}
  + }
  + return result;
  + }, {});
  + if (!isEmpty(pull)) {
  return appsDb.update(
  - { 'triggers.handlers.actionId': actionId },
  - { $pull: { [`triggers.${triggerIndex}.handlers`]: { actionId } } },
  - {});
  + {'triggers.handlers.actionId': actionId}, {$pull: pull}, {});
  }
  return null;
  })
  