docusaurus-theme-openapi-docs
Version:
OpenAPI theme for Docusaurus.
26 lines (25 loc) • 955 B
JavaScript
;
/* ============================================================================
* Copyright (c) Palo Alto Networks
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* ========================================================================== */
Object.defineProperty(exports, "__esModule", { value: true });
exports.setParam = exports.slice = void 0;
const toolkit_1 = require("@reduxjs/toolkit");
const initialState = {};
exports.slice = (0, toolkit_1.createSlice)({
name: "params",
initialState,
reducers: {
setParam: (state, action) => {
const newParam = action.payload;
const paramGroup = state[action.payload.in];
const index = paramGroup.findIndex((p) => p.name === newParam.name);
paramGroup[index] = newParam;
},
},
});
exports.setParam = exports.slice.actions.setParam;
exports.default = exports.slice.reducer;