Skip to content

Commit 3b77204

Browse files
authored
M #-: Ensure that vms paginated request is an array (#3694)
Signed-off-by: dcarracedo <dcarracedo@opennebula.io>
1 parent cf9979e commit 3b77204

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/fireedge/src/modules/features/OneApi/vm.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ const vmApi = oneApi.injectEndpoints({
102102

103103
getVmsPaginated: builder.query({
104104
/**
105-
* Fetches information for all or part of
106-
* the VMs in the pool by running concurrent jobs
107-
* and collecting the results in the backend. (FASTER)
105+
* Fetches information for all or part of the VMs in the pool by running concurrent jobs and collecting the results in the backend. (FASTER).
108106
*
109107
* @param {object} params - Request parameters
110108
* @param {0|1} params.extended

src/fireedge/src/server/routes/api/vmpool/functions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ const fetchPaginatedPool = async (
269269
parameters: fParams,
270270
})
271271

272-
return data || []
272+
const ensureData = data && !Array.isArray(data) ? [data] : data
273+
274+
return ensureData || []
273275
}
274276

275277
const runBatches = async () => {

0 commit comments

Comments
 (0)