@bigbinary/neeto-email-notifications-frontend 1.3.2 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import React, { createContext, useContext, useState, useRef, useEffect } from 'react';
2
2
  import classNames from 'classnames';
3
+ import { isNotEmpty, noop as noop$1 } from '@bigbinary/neeto-commons-frontend/pure';
3
4
  import { EmailFormProvider, EmailForm, EmailPreview } from '@bigbinary/neeto-molecules/EmailForm';
4
5
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
5
6
  import { Tooltip, Typography } from '@bigbinary/neetoui';
6
7
  import { Switch } from '@bigbinary/neetoui/formik';
7
8
  import { prop, isEmpty, pluck } from 'ramda';
8
9
  import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
9
- import { isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
10
10
  import { useQuery, useQueryClient, useMutation } from 'react-query';
11
11
  import axios from 'axios';
12
12
  import * as yup from 'yup';
@@ -2640,11 +2640,11 @@ var emailNotificationsApi = {
2640
2640
  };
2641
2641
 
2642
2642
  var QUERY_KEYS = {
2643
- EMAIL_NOTIFICATIONS: "email-notifications"
2643
+ NEETO_EMAIL_NOTIFICATIONS: "neeto-email-notifications"
2644
2644
  };
2645
2645
 
2646
2646
  var useFetchEmailNotifications = function useFetchEmailNotifications(params) {
2647
- return useQuery([QUERY_KEYS.EMAIL_NOTIFICATIONS, params["notificationHolderId"], params["customFields"]], function () {
2647
+ return useQuery([QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS, params["notificationHolderId"], params["customFields"]], function () {
2648
2648
  return emailNotificationsApi.fetch(params);
2649
2649
  }, {
2650
2650
  staleTime: DEFAULT_STALE_TIME,
@@ -2659,7 +2659,7 @@ var useUpdateEmailNotification = function useUpdateEmailNotification() {
2659
2659
  }, {
2660
2660
  onSuccess: function onSuccess(_, _ref) {
2661
2661
  var notificationHolderId = _ref.notificationHolderId;
2662
- return queryClient.invalidateQueries([QUERY_KEYS.EMAIL_NOTIFICATIONS, notificationHolderId]);
2662
+ return queryClient.invalidateQueries([QUERY_KEYS.NEETO_EMAIL_NOTIFICATIONS, notificationHolderId]);
2663
2663
  }
2664
2664
  });
2665
2665
  };
@@ -2788,6 +2788,8 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
2788
2788
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
2789
2789
  _ref$tooltipProps = _ref.tooltipProps,
2790
2790
  tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
2791
+ _ref$onSuccess = _ref.onSuccess,
2792
+ onSuccess = _ref$onSuccess === void 0 ? noop$1 : _ref$onSuccess,
2791
2793
  children = _ref.children;
2792
2794
  var _useTranslation = useTranslation(),
2793
2795
  t = _useTranslation.t;
@@ -2801,7 +2803,9 @@ var NeetoEmailNotificationForm = function NeetoEmailNotificationForm(_ref) {
2801
2803
  var emailNotification = packEmailPayload(values);
2802
2804
  updateEmailNotification(_objectSpread({
2803
2805
  emailNotification: emailNotification
2804
- }, emailNotificationParams));
2806
+ }, emailNotificationParams), {
2807
+ onSuccess: onSuccess
2808
+ });
2805
2809
  };
2806
2810
  if (isLoading) {
2807
2811
  return /*#__PURE__*/React.createElement(PageLoader, null);