Skip to content

Commit

Permalink
4908 rules meta info update
Browse files Browse the repository at this point in the history
  • Loading branch information
remizov-arena committed Aug 26, 2024
1 parent f431300 commit 8782628
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions smart-frontend/app/src/store/adh/rules/rulesActionsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ const stopRule = createAsyncThunk('adh/rulesActions/stopRule', async (ruleId: nu
}
});

const withFullUpdate = (name: string, dialogAction: ReturnType<typeof createAsyncThunk>) => {
type DialogActionType = ReturnType<typeof createAsyncThunk>;

const withFullUpdate = (name: string, dialogAction: DialogActionType) => {
return createAsyncThunk(name, async (payload: unknown, thunkAPI) => {
await thunkAPI.dispatch(dialogAction(payload)).unwrap();
thunkAPI.dispatch(getRulesMetaInfo());
thunkAPI.dispatch(getRules());
});
};

const withMetaInfoUpdate = (name: string, dialogAction: ReturnType<typeof createAsyncThunk>) => {
const withMetaInfoUpdate = (name: string, dialogAction: DialogActionType) => {
return createAsyncThunk(name, async (payload: unknown, thunkAPI) => {
await thunkAPI.dispatch(dialogAction(payload)).unwrap();
thunkAPI.dispatch(getRulesMetaInfo());
Expand Down

0 comments on commit 8782628

Please sign in to comment.