"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.unfreezeIndicesStart = exports.unfreezeIndices = void 0; var _reduxActions = require("redux-actions"); var _i18n = require("@kbn/i18n"); var _services = require("../../services"); var _ = require("."); var _notification = require("../../services/notification"); /* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ const unfreezeIndicesStart = (0, _reduxActions.createAction)('INDEX_MANAGEMENT_UNFREEZE_INDICES_START'); exports.unfreezeIndicesStart = unfreezeIndicesStart; const unfreezeIndices = ({ indexNames }) => async dispatch => { dispatch(unfreezeIndicesStart({ indexNames })); try { await (0, _services.unfreezeIndices)(indexNames); } catch (error) { _notification.notificationService.showDangerToast(error.body.message); return dispatch((0, _.clearRowStatus)({ indexNames })); } dispatch((0, _.reloadIndices)(indexNames)); _notification.notificationService.showSuccessToast(_i18n.i18n.translate('xpack.idxMgmt.unfreezeIndicesAction.successfullyUnfrozeIndicesMessage', { defaultMessage: 'Successfully unfroze: [{indexNames}]', values: { indexNames: indexNames.join(', ') } })); }; exports.unfreezeIndices = unfreezeIndices;