1
0
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:
vichansson 2023-10-26 18:49:23 +03:00 committed by GitHub
parent e4a26f947e
commit ef3d15148b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View File

@ -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)

View File

@ -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')

View File

@ -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
}

View File

@ -786,7 +786,7 @@ module.exports = {
params: {
filter: {
from: query,
default: -2,
default: -3,
},
start: {
from: query,