Skip to content

Commit bc9261f

Browse files
phixMephixwslulciuc
authored
Fixing dataset saga for paging (#2615)
* Fixing dataset saga. Co-authored-by: phix <peter.hicks@astronomer.io> * Remove log. Co-authored-by: phix <peter.hicks@astronomer.io> --------- Co-authored-by: phix <peter.hicks@astronomer.io> Co-authored-by: Willy Lulciuc <willy@datakin.com>
1 parent 8bf67a5 commit bc9261f

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

web/src/store/requests/datasets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { API_URL } from '../../globals'
55
import { Dataset, DatasetVersions, Datasets } from '../../types/api'
66
import { genericFetchWrapper } from './index'
77

8-
export const getDatasets = async (namespace: string, limit = 25, offset = 0) => {
8+
export const getDatasets = async (namespace: string, limit = 20, offset = 0) => {
99
const url = `${API_URL}/namespaces/${encodeURIComponent(
1010
namespace
1111
)}/datasets?limit=${limit}&offset=${offset}`

web/src/store/sagas/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,12 @@ export function* fetchDatasetsSaga() {
156156
while (true) {
157157
try {
158158
const { payload } = yield take(FETCH_DATASETS)
159-
const datasets: Datasets = yield call(getDatasets, payload.namespace)
159+
const datasets: Datasets = yield call(
160+
getDatasets,
161+
payload.namespace,
162+
payload.limit,
163+
payload.offset
164+
)
160165
yield put(fetchDatasetsSuccess(datasets.datasets, datasets.totalCount))
161166
} catch (e) {
162167
yield put(applicationError('Something went wrong while fetching dataset runs'))

0 commit comments

Comments
 (0)