Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to react-admin v5 #633

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix pagination
dklimpel committed Oct 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 2f165294ad7b0370412ba5ad5dc07352ebb7d6f8
17 changes: 12 additions & 5 deletions src/synapse/dataProvider.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { stringify } from "query-string";

import { DataProvider, DeleteParams, Identifier, Options, RaRecord, fetchUtils } from "react-admin";

import {
DataProvider,
DeleteParams,
Identifier,
Options,
PaginationPayload,
RaRecord,
SortPayload,
fetchUtils
} from "react-admin";
import storage from "../storage";

// Adds the access token to all requests
@@ -492,8 +499,8 @@ const dataProvider: SynapseDataProvider = {
getList: async (resource, params) => {
console.log("getList " + resource);
const { user_id, name, guests, deactivated, search_term, destination, valid } = params.filter;
const { page, perPage } = params.pagination;
const { field, order } = params.sort;
const { page, perPage } = params.pagination as PaginationPayload;
const { field, order } = params.sort as SortPayload;
const from = (page - 1) * perPage;
const query = {
from: from,