Skip to content

Commit

Permalink
Fixed incorrect Cloud Storage request by ID (#7823)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Apr 30, 2024
1 parent ab8674c commit f2924d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Infinite loading cloud storage update page when a lot of cloud storages are available for a user
(<https://github.com/cvat-ai/cvat/pull/7823>)
9 changes: 6 additions & 3 deletions cvat-core/src/server-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1937,18 +1937,21 @@ async function getCloudStorages(filter = {}): Promise<SerializedCloudStorage[] &

let response = null;
try {
if ('id' in filter) {
response = await Axios.get(`${backendAPI}/cloudstorages/${filter.id}`);
return Object.assign([response.data], { count: 1 });
}

response = await Axios.get(`${backendAPI}/cloudstorages`, {
params: {
...filter,
page_size: 12,
},
});
return Object.assign(response.data.results, { count: response.data.count });
} catch (errorData) {
throw generateError(errorData);
}

response.data.results.count = response.data.count;
return response.data.results;
}

async function getCloudStorageContent(id: number, path: string, nextToken?: string, manifestPath?: string):
Expand Down

0 comments on commit f2924d4

Please sign in to comment.