Progress
This commit is contained in:
@@ -3,7 +3,7 @@ import { Button, Card, Input, Space, Table, Typography } from "antd";
|
||||
import queryString from "query-string";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link, useNavigate, useLocation } from "react-router-dom";
|
||||
import { Link, useNavigate, useSearchParams } from "react-router-dom";
|
||||
import PhoneFormatter from "../../utils/PhoneFormatter";
|
||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||
import {pageLimit} from "../../utils/config";
|
||||
@@ -14,7 +14,7 @@ export default function OwnersListComponent({
|
||||
total,
|
||||
refetch,
|
||||
}) {
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const search = queryString.parse(useSearchParams().toString());
|
||||
const {
|
||||
page,
|
||||
// sortcolumn, sortorder
|
||||
@@ -79,7 +79,7 @@ export default function OwnersListComponent({
|
||||
search.page = pagination.current;
|
||||
search.sortcolumn = sorter.columnKey;
|
||||
search.sortorder = sorter.order;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
history({ search: queryString.stringify(search) });
|
||||
};
|
||||
return (
|
||||
<Card
|
||||
@@ -94,7 +94,7 @@ export default function OwnersListComponent({
|
||||
<Button
|
||||
onClick={() => {
|
||||
delete search.search;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
history({ search: queryString.stringify(search) });
|
||||
}}
|
||||
>
|
||||
{t("general.actions.clear")}
|
||||
@@ -112,7 +112,7 @@ export default function OwnersListComponent({
|
||||
} else {
|
||||
delete search.search;
|
||||
}
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
history({ search: queryString.stringify(search) });
|
||||
}}
|
||||
enterButton
|
||||
/>
|
||||
|
||||
@@ -4,11 +4,11 @@ import { QUERY_ALL_OWNERS_PAGINATED } from "../../graphql/owners.queries";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import OwnersListComponent from "./owners-list.component";
|
||||
import queryString from "query-string";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
import {pageLimit} from "../../utils/config";
|
||||
|
||||
export default function OwnersListContainer() {
|
||||
const searchParams = queryString.parse(useLocation().search);
|
||||
const searchParams = queryString.parse(useSearchParams().toString());
|
||||
const { page, sortcolumn, sortorder, search } = searchParams;
|
||||
const { loading, error, data, refetch } = useQuery(
|
||||
QUERY_ALL_OWNERS_PAGINATED,
|
||||
|
||||
Reference in New Issue
Block a user