Fix issues with limits.

This commit is contained in:
Dave Richer
2023-11-29 17:27:08 -05:00
parent 0d70545b98
commit 4b289388bf
12 changed files with 32 additions and 23 deletions

View File

@@ -11,6 +11,7 @@ import {
} from "../../redux/application/application.actions";
import AlertComponent from "../alert/alert.component";
import InventoryListPaginated from "./inventory-list.component";
import {pageLimit} from "../../utils/config";
const mapStateToProps = createStructuredSelector({
//bodyshop: selectBodyshop,
@@ -32,8 +33,8 @@ export function InventoryList({ setBreadcrumbs, setSelectedHeader }) {
nextFetchPolicy: "network-only",
variables: {
search: search || "",
offset: page ? (page - 1) * 25 : 0,
limit: 25,
offset: page ? (page - 1) * pageLimit : 0,
limit: pageLimit,
consumedIsNull: showall === "true" ? null : true,
order: [
{

View File

@@ -38,7 +38,7 @@ export function JobsList({bodyshop,}) {
const {loading, error, data, refetch} = useQuery(QUERY_ALL_ACTIVE_JOBS_PAGINATED, {
variables: {
offset: page ? (page - 1) * pageLimit : 0,
limit: 10,
limit: pageLimit,
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
order: [
{

View File

@@ -5,6 +5,7 @@ import AlertComponent from "../alert/alert.component";
import OwnersListComponent from "./owners-list.component";
import queryString from "query-string";
import { useLocation } from "react-router-dom";
import {pageLimit} from "../../utils/config";
export default function OwnersListContainer() {
const searchParams = queryString.parse(useLocation().search);
@@ -16,8 +17,8 @@ export default function OwnersListContainer() {
nextFetchPolicy: "network-only",
variables: {
search: search || "",
offset: page ? (page - 1) * 25 : 0,
limit: 25,
offset: page ? (page - 1) * pageLimit : 0,
limit: pageLimit,
order: [
{
[sortcolumn || "created_at"]: sortorder

View File

@@ -5,6 +5,7 @@ import AlertComponent from "../alert/alert.component";
import { QUERY_ALL_VEHICLES_PAGINATED } from "../../graphql/vehicles.queries";
import queryString from "query-string";
import { useLocation } from "react-router-dom";
import {pageLimit} from "../../utils/config";
export default function VehiclesListContainer() {
const searchParams = queryString.parse(useLocation().search);
@@ -15,8 +16,8 @@ export default function VehiclesListContainer() {
{
variables: {
search: search || "",
offset: page ? (page - 1) * 25 : 0,
limit: 25,
offset: page ? (page - 1) * pageLimit : 0,
limit: pageLimit,
order: [
{
[sortcolumn || "created_at"]: sortorder