mattermost-redux
Version:
Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client
26 lines (25 loc) • 1.54 kB
JavaScript
;
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
Object.defineProperty(exports, "__esModule", { value: true });
const redux_1 = require("redux");
const action_types_1 = require("mattermost-redux/action_types");
const helpers_1 = require("./helpers");
function getRolesByNames(state = (0, helpers_1.initialRequestState)(), action) {
return (0, helpers_1.handleRequest)(action_types_1.RoleTypes.ROLES_BY_NAMES_REQUEST, action_types_1.RoleTypes.ROLES_BY_NAMES_SUCCESS, action_types_1.RoleTypes.ROLES_BY_NAMES_FAILURE, state, action);
}
function getRoleByName(state = (0, helpers_1.initialRequestState)(), action) {
return (0, helpers_1.handleRequest)(action_types_1.RoleTypes.ROLE_BY_NAME_REQUEST, action_types_1.RoleTypes.ROLE_BY_NAME_SUCCESS, action_types_1.RoleTypes.ROLE_BY_NAME_FAILURE, state, action);
}
function getRole(state = (0, helpers_1.initialRequestState)(), action) {
return (0, helpers_1.handleRequest)(action_types_1.RoleTypes.ROLE_BY_ID_REQUEST, action_types_1.RoleTypes.ROLE_BY_ID_SUCCESS, action_types_1.RoleTypes.ROLE_BY_ID_FAILURE, state, action);
}
function editRole(state = (0, helpers_1.initialRequestState)(), action) {
return (0, helpers_1.handleRequest)(action_types_1.RoleTypes.EDIT_ROLE_REQUEST, action_types_1.RoleTypes.EDIT_ROLE_SUCCESS, action_types_1.RoleTypes.EDIT_ROLE_FAILURE, state, action);
}
exports.default = (0, redux_1.combineReducers)({
getRolesByNames,
getRoleByName,
getRole,
editRole,
});