Skip to content
Snippets Groups Projects
Commit ac59b115 authored by Egor Fuchezhi's avatar Egor Fuchezhi
Browse files

PicoUI-9: Added enum for redux action types

parent e9fa96f6
No related branches found
No related tags found
1 merge request!1136chore: incorporate webui submodule
import { createAsyncThunk, createSlice } from "@reduxjs/toolkit";
import { ClusterInfoType, ReplicasetType } from "./types";
import { ActionTypes, ClusterInfoType, ReplicasetType } from "./types";
export interface ClusterState {
clusterInfo: ClusterInfoType;
......@@ -40,7 +40,7 @@ const initialState: ClusterState = {
};
export const getReplicasets = createAsyncThunk<ReplicasetType[]>(
"cluster/getReplicasets",
ActionTypes.getReplicasetsType,
async () => {
return new Promise((res) => {
res([
......@@ -158,7 +158,7 @@ export const getReplicasets = createAsyncThunk<ReplicasetType[]>(
);
export const getClusterInfo = createAsyncThunk<ClusterInfoType>(
"cluster/getClusterInfo",
ActionTypes.getClusterInfoType,
async () => {
return new Promise((res) => {
res({
......
......@@ -26,3 +26,8 @@ export interface ClusterInfoType {
instancesCurrentGradeOffline: number;
currentInstaceVersion: string;
}
export enum ActionTypes {
getClusterInfoType = "cluster/getClusterInfo",
getReplicasetsType = "cluster/getReplicasets",
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment