Skip to content

Commit 78650d2

Browse files
committed
feat: remove query limit
1 parent 74dd69e commit 78650d2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/hooks/useGetOrders.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import { db } from "../config";
2-
import { collection, getDocs, limit, query } from "firebase/firestore";
2+
import { collection, getDocs, query } from "firebase/firestore";
33
import { useQuery } from "@tanstack/react-query";
44
import { ORDERS_COLLECTION } from "../constants";
55
import { Order } from "../types/Order";
66

7-
const ORDER_LIMIT = 1000;
8-
97
const useGetOrders = () => {
108
return useQuery({
119
queryKey: [ORDERS_COLLECTION],
1210
queryFn: async () => {
1311
const clientsRef = collection(db, ORDERS_COLLECTION);
14-
const snapshot = await getDocs(query(clientsRef, limit(ORDER_LIMIT)));
12+
const snapshot = await getDocs(query(clientsRef));
1513
const orderObjects = snapshot.docs.map((doc) => {
1614
const data = doc.data();
1715
return {

0 commit comments

Comments
 (0)