mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-20 14:03:36 +03:00
M #-: Fix API filtering (#2793)
Fixes a bug where API filter flags always were ignored. Signed-off-by: Victor Hansson <vhansson@opennebula.io>
This commit is contained in:
parent
e4a26f947e
commit
ef3d15148b
@ -40,7 +40,9 @@ const TIMEOUT = 8000 // 8 seconds
|
||||
* @returns {object} - Returns an object containing the processed data, loading state, and any error.
|
||||
*/
|
||||
export const useAccountingData = ({ id }) => {
|
||||
const { data: fetchedData } = useGetAccountingPoolQuery({ filter: id })
|
||||
const { data: fetchedData } = useGetAccountingPoolQuery({
|
||||
filter: id,
|
||||
})
|
||||
const [data, setData] = useState(null)
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
|
@ -55,7 +55,7 @@ const DATASETS_LIMIT = 4
|
||||
*/
|
||||
const AccountingInfoTab = ({ id }) => {
|
||||
const [dateRange, setDateRange] = useState(getDefaultDateRange()) // LAST 7 DAYS
|
||||
const { data, isLoading, error } = useAccountingData(id)
|
||||
const { data, isLoading, error } = useAccountingData({ id })
|
||||
const [datasets, setDatasets] = useState([])
|
||||
const [visibleDatasets, setVisibleDatasets] = useState([])
|
||||
const [chartType, setChartType] = useState('line')
|
||||
|
@ -86,7 +86,7 @@ const oneApi = createApi({
|
||||
|
||||
try {
|
||||
// set filter flag if filter is present in command params
|
||||
if (command?.params?.filter) {
|
||||
if (!paramsExtensible?.filter && command?.params?.filter) {
|
||||
paramsExtensible.filter = getState().auth?.filterPool
|
||||
}
|
||||
|
||||
|
@ -786,7 +786,7 @@ module.exports = {
|
||||
params: {
|
||||
filter: {
|
||||
from: query,
|
||||
default: -2,
|
||||
default: -3,
|
||||
},
|
||||
start: {
|
||||
from: query,
|
||||
|
Loading…
x
Reference in New Issue
Block a user