-
(
-
- {i18next.t("general:Records")}
-
- )}
- loading={this.state.loading}
- onChange={this.handleTableChange}
- />
-
- );
- }
-
- fetch = (params = {}) => {
- let field = params.searchedColumn, value = params.searchText;
- const sortField = params.sortField, sortOrder = params.sortOrder;
- if (params.method !== undefined && params.method !== null) {
- field = "method";
- value = params.method;
- }
- this.setState({loading: true});
- RecordBackend.getRecords(Setting.isDefaultOrganizationSelected(this.props.account) ? "" : Setting.getRequestOrganization(this.props.account), params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
- .then((res) => {
- this.setState({
- loading: false,
- });
- if (res.status === "ok") {
- this.setState({
- data: res.data,
- pagination: {
- ...params.pagination,
- total: res.data2,
- },
- searchText: params.searchText,
- searchedColumn: params.searchedColumn,
- });
- } else {
- if (res.data.includes("Please login first")) {
- this.setState({
- loading: false,
- isAuthorized: false,
- });
- }
- }
- });
- };
-}
-
-export default RecordListPage;
diff --git a/web/src/backend/RecordBackend.js b/web/src/backend/RecordBackend.js
deleted file mode 100644
index bcc5b574..00000000
--- a/web/src/backend/RecordBackend.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2021 The Casdoor Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import * as Setting from "../Setting";
-
-export function getRecords(organizationName, page, pageSize, field = "", value = "", sortField = "", sortOrder = "") {
- return fetch(`${Setting.ServerUrl}/api/get-records?organizationName=${organizationName}&pageSize=${pageSize}&p=${page}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
- method: "GET",
- credentials: "include",
- headers: {
- "Accept-Language": Setting.getAcceptLanguage(),
- },
- }).then(res => res.json());
-}