Skip to content

Commit 5eeb382

Browse files
committed
#RI-2930 - add interfaces, fix loading state
1 parent d433022 commit 5eeb382

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

redisinsight/ui/src/pages/browser/components/key-details-add-items/add-stream-group/AddStreamGroup.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ import {
1313
import cx from 'classnames'
1414
import React, { ChangeEvent, useEffect, useState } from 'react'
1515
import { useDispatch, useSelector } from 'react-redux'
16+
1617
import { selectedKeyDataSelector } from 'uiSrc/slices/browser/keys'
1718
import { addNewGroupAction } from 'uiSrc/slices/browser/stream'
1819
import { consumerGroupIdRegex, validateConsumerGroupId } from 'uiSrc/utils'
20+
import { CreateConsumerGroupsDto } from 'apiSrc/modules/browser/dto/stream.dto'
1921

2022
import styles from './styles.module.scss'
2123

@@ -50,7 +52,7 @@ const AddStreamGroup = (props: Props) => {
5052

5153
const submitData = () => {
5254
if (isFormValid) {
53-
const data: any = {
55+
const data: CreateConsumerGroupsDto = {
5456
keyName,
5557
consumerGroups: [{
5658
name: groupName,

redisinsight/ui/src/slices/browser/stream.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
AddStreamEntriesResponse,
1414
ConsumerDto,
1515
ConsumerGroupDto,
16+
CreateConsumerGroupsDto,
1617
GetStreamEntriesResponse,
1718
PendingEntryDto,
1819
} from 'apiSrc/modules/browser/dto/stream.dto'
@@ -113,7 +114,7 @@ const streamSlice = createSlice({
113114
state.error = ''
114115
},
115116
addNewGroupSuccess: (state) => {
116-
state.loading = true
117+
state.loading = false
117118
},
118119
addNewGroupFailure: (state, { payload }) => {
119120
state.loading = false
@@ -494,7 +495,7 @@ export function deleteStreamEntry(key: string, entries: string[], onSuccessActio
494495

495496
// Asynchronous thunk action
496497
export function addNewGroupAction(
497-
data: any,
498+
data: CreateConsumerGroupsDto,
498499
onSuccess?: () => void,
499500
onFail?: () => void
500501
) {
@@ -503,7 +504,7 @@ export function addNewGroupAction(
503504

504505
try {
505506
const state = stateInit()
506-
const { status } = await apiService.post<any>(
507+
const { status } = await apiService.post(
507508
getUrl(
508509
state.connections.instances.connectedInstance?.id,
509510
ApiEndpoints.STREAMS_CONSUMER_GROUPS

0 commit comments

Comments
 (0)