fix: getting docId, storeId parameters (#3761)

* fix: getting docId, storeId parameters

* useparams to get path params

---------

Co-authored-by: Henry <hzj94@hotmail.com>
This commit is contained in:
Danila
2025-01-03 15:33:50 +03:00
committed by GitHub
parent d71ad22e27
commit b6165e3578
7 changed files with 18 additions and 27 deletions
@@ -1,6 +1,6 @@
import { useEffect, useState, useRef } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { useNavigate } from 'react-router-dom'
import { useNavigate, useParams } from 'react-router-dom'
import ReactJson from 'flowise-react-json-view'
import { cloneDeep } from 'lodash'
import { v4 as uuidv4 } from 'uuid'
@@ -63,8 +63,7 @@ const VectorStoreQuery = () => {
const enqueueSnackbar = (...args) => dispatch(enqueueSnackbarAction(...args))
const closeSnackbar = (...args) => dispatch(closeSnackbarAction(...args))
const URLpath = document.location.pathname.toString().split('/')
const storeId = URLpath[URLpath.length - 1] === 'document-stores' ? '' : URLpath[URLpath.length - 1]
const { storeId } = useParams()
const [documentChunks, setDocumentChunks] = useState([])
const [loading, setLoading] = useState(false)