mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-11 17:26:32 +02:00
Remove infinite grid loading, useInfiniteGrid hook, and server-side pagination API route. Revert grid components to the simpler version that avoids 2MB+ cache failures from unstable_cache. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
"use server";
|
|
|
|
import { getSitesFromApi } from "@/lib/api-ff-client";
|
|
import { pgGetFournisseurs } from "@/lib/pg-ff-client";
|
|
import { getProductRows } from "./api/get-product-rows";
|
|
import type { ProductRow, GridFilters } from "@/types/grid";
|
|
|
|
/**
|
|
* Get the list of all suppliers from PostgreSQL (fouadr1).
|
|
*/
|
|
export async function getFournisseurs() {
|
|
return pgGetFournisseurs();
|
|
}
|
|
|
|
/**
|
|
* Get the list of all stores (sites) from the FF Nancy API.
|
|
*/
|
|
export async function getMagasins() {
|
|
return getSitesFromApi();
|
|
}
|
|
|
|
/**
|
|
* Nomenclature filter is disabled — code3 is not available from the API.
|
|
* Returns an empty hierarchy so the sidebar filter is hidden gracefully.
|
|
*/
|
|
export async function getAvailableNomenclature() {
|
|
return {};
|
|
}
|
|
|
|
/**
|
|
* Get product data for a specific supplier and store.
|
|
*/
|
|
export async function getGridData(
|
|
codeFournisseur: string,
|
|
magasin: string = "TOTAL",
|
|
filters?: Partial<GridFilters>
|
|
): Promise<ProductRow[]> {
|
|
return getProductRows({ codeFournisseur, magasin, filters });
|
|
}
|