Skip to content

Commit

Permalink
[Fixes #1531] Remove the call to the upload view for listing pending …
Browse files Browse the repository at this point in the history
…uploads (#1532)

* Remove the call to the upload API to receive pending uploads

* Remvoed unused getPendingUploads
  • Loading branch information
giohappy authored Aug 10, 2023
1 parent 377823a commit 3693649
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
12 changes: 0 additions & 12 deletions geonode_mapstore_client/client/js/api/geonode/v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -655,17 +655,6 @@ export const downloadResource = (resource) => {
.then(({ data, headers }) => ({output: data, headers}));
};

export const getPendingUploads = () => {
return axios.get(parseDevHostname(endpoints[UPLOADS]), {
params: {
'filter{-state}': 'PROCESSED',
'page': 1,
'page_size': 99999
}
})
.then(({ data }) => data?.uploads);
};

export const getPendingExecutionRequests = () => {
return axios.get(parseDevHostname(endpoints[EXECUTIONREQUEST]), {
params: {
Expand Down Expand Up @@ -870,7 +859,6 @@ export default {
copyResource,
downloadResource,
getDatasets,
getPendingUploads,
getPendingExecutionRequests,
getProcessedUploadsById,
getProcessedUploadsByImportId,
Expand Down
4 changes: 1 addition & 3 deletions geonode_mapstore_client/client/js/routes/UploadDataset.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import merge from 'lodash/merge';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import {
getPendingUploads,
getProcessedUploadsById,
getProcessedUploadsByImportId,
uploadDataset,
Expand Down Expand Up @@ -233,8 +232,7 @@ function ProcessingUploadList({
updatePending.current = () => {
if (!loading) {
setLoading(true);
axios.all([getPendingUploads(), getPendingExecutionRequests()])
.then(incomingUploads => [...incomingUploads[0], ...incomingUploads[1]])
getPendingExecutionRequests()
.then((newPendingUploads) => {
if (isMounted.current) {
const failedPendingUploads = pendingUploads.filter(({ state }) => state === 'INVALID');
Expand Down

0 comments on commit 3693649

Please sign in to comment.