Skip to content

Commit

Permalink
misc: default page in query is 1 not 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ansmonjol committed Oct 28, 2024
1 parent dde6435 commit ab3b53c
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/components/creditNote/CreditNotesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const CreditNotesTable = ({
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = metadata || {}
const { currentPage = 1, totalPages = 0 } = metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/customerPortal/PortalInvoicesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const PortalInvoicesList = () => {
const hasSearchTerm = !!variables?.searchTerm
const hasNoInvoices = !loading && !error && !metadata?.totalCount && !hasSearchTerm

const { currentPage = 0, totalPages = 0 } = metadata || {}
const { currentPage = 1, totalPages = 0 } = metadata || {}

if (error) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/customers/CustomerInvoicesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const CustomerInvoicesList: FC<CustomerInvoicesListProps> = ({
onBottom={() => {
if (!fetchMore) return

const { currentPage = 0, totalPages = 0 } = invoiceData?.metadata || {}
const { currentPage = 1, totalPages = 0 } = invoiceData?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/invoices/InvoicesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const InvoicesList = ({
<div ref={listContainerElementRef}>
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = metadata || {}
const { currentPage = 1, totalPages = 0 } = metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/plans/details/PlanSubscriptionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const PlanSubscriptionList = ({ planCode }: { planCode?: string }) => {
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } =
const { currentPage = 1, totalPages = 0 } =
subscriptionResult?.subscriptions?.metadata || {}

currentPage < totalPages &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const AnrokIntegrationItemsListAddons = ({
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.addOns?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.addOns?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const AnrokIntegrationItemsListBillableMetrics = ({
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.billableMetrics?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.billableMetrics?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const NetsuiteIntegrationItemsListAddons = ({
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.addOns?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.addOns?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const NetsuiteIntegrationItemsListBillableMetrics = ({
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.billableMetrics?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.billableMetrics?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const XeroIntegrationItemsListAddons = ({
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.addOns?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.addOns?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const XeroIntegrationItemsListBillableMetrics = ({
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.billableMetrics?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.billableMetrics?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/wallets/CustomerWalletList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const CustomerWalletsList = ({ customerId, customerTimezone }: CustommerW
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.wallets?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.wallets?.metadata || {}

currentPage < totalPages &&
!loading &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/wallets/WalletTransactionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const WalletTransactionList = forwardRef<TopupWalletDialogRef, WalletTran
notifyOnNetworkStatusChange: true,
})
const list = data?.walletTransactions?.collection
const { currentPage = 0, totalPages = 0 } = data?.walletTransactions?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.walletTransactions?.metadata || {}
const hasData = !!list && !!list?.length

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/AddOnsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const AddOnsList = () => {
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.addOns?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.addOns?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/pages/BillableMetricsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const BillableMetricsList = () => {
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.billableMetrics?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.billableMetrics?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CouponsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const CouponsList = () => {
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.coupons?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.coupons?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/pages/CustomersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const CustomersList = () => {
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.customers?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.customers?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PlansList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const PlansList = () => {
) : (
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.plans?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.plans?.metadata || {}

currentPage < totalPages &&
!isLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/pages/developers/Debugger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const Debugger = () => {
{((loading && !data?.events?.collection) || refetchLoading) && <DateHeader />}
<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = data?.events?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.events?.metadata || {}

currentPage < totalPages &&
!loading &&
Expand Down
2 changes: 1 addition & 1 deletion src/pages/developers/WebhookLogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const WebhookLogs = () => {
{isLoading && !fetchMoreLoading && !hasLogs && <DateHeader />}
<InfiniteScroll
onBottom={async () => {
const { currentPage = 0, totalPages = 0 } = data?.webhooks?.metadata || {}
const { currentPage = 1, totalPages = 0 } = data?.webhooks?.metadata || {}

if (currentPage < totalPages && !isLoading) {
setFetchMoreLoading(true)
Expand Down
4 changes: 2 additions & 2 deletions src/pages/settings/Members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const Members = () => {
const invitesMetadata = invitesData?.invites.metadata
const membersMetadata = membersData?.memberships.metadata
const hasInvites = !!invitesMetadata?.totalCount
const { currentPage: inviteCurrentPage = 0, totalPages: inviteTotalPages = 0 } =
const { currentPage: inviteCurrentPage = 1, totalPages: inviteTotalPages = 0 } =
invitesMetadata || {}

return (
Expand Down Expand Up @@ -319,7 +319,7 @@ const Members = () => {

<InfiniteScroll
onBottom={() => {
const { currentPage = 0, totalPages = 0 } = membersMetadata || {}
const { currentPage = 1, totalPages = 0 } = membersMetadata || {}

currentPage < totalPages &&
!membersLoading &&
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings/TaxesSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const TaxesSettings = () => {
<InfiniteScroll
onBottom={() => {
if (!fetchMore) return
const { currentPage = 0, totalPages = 0 } = metadata || {}
const { currentPage = 1, totalPages = 0 } = metadata || {}

currentPage < totalPages &&
!loading &&
Expand Down

0 comments on commit ab3b53c

Please sign in to comment.