[dyad] Removing item limit on Stock Management screen - wrote 1 file(s) + extra files edited outside of Dyad

This commit is contained in:
[dyad] 2025-09-23 16:10:25 +02:00
parent a57db8f58c
commit 177c0c6af4

View file

@ -13,6 +13,7 @@ import {
} from "@/components/ui/dialog"
import { AddItemForm } from "../components/stock/AddItemForm"
import pb from "@/lib/pocketbase"
import { showError } from "@/utils/toast"
const Stock = () => {
const [addItemOpen, setAddItemOpen] = useState(false);
@ -22,10 +23,10 @@ const Stock = () => {
const fetchStockItems = useCallback(async () => {
try {
const records = await pb.collection('stock_items').getList(1, 50, {
const records = await pb.collection('stock_items').getFullList({
sort: '-created',
});
const formattedData: StockItem[] = records.items.map((item: any) => ({
const formattedData: StockItem[] = records.map((item: any) => ({
id: item.id,
name: item.name,
sku: item.sku,
@ -37,6 +38,7 @@ const Stock = () => {
setStockItems(formattedData);
} catch (error) {
console.error("Error fetching stock items:", error);
showError("Failed to load stock items.");
}
}, []);