Paginate Olist monitor history
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m17s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m17s
This commit is contained in:
@@ -276,8 +276,9 @@ export const fetchCatalogSummary = async (): Promise<CatalogSummary> => {
|
||||
}
|
||||
};
|
||||
|
||||
export const fetchOlistStatus = async (): Promise<OlistStatus> => {
|
||||
const response = await authFetch('/olist/status', { cache: 'no-store' });
|
||||
export const fetchOlistStatus = async (runsPage = 1, runsPageSize = 5): Promise<OlistStatus> => {
|
||||
const params = new URLSearchParams({ runsPage: String(runsPage), runsPageSize: String(runsPageSize) });
|
||||
const response = await authFetch(`/olist/status?${params}`, { cache: 'no-store' });
|
||||
const data = await response.json().catch(() => null);
|
||||
if (!response.ok) throw new Error(data?.error || 'Não foi possível consultar a integração Olist.');
|
||||
return data as OlistStatus;
|
||||
@@ -314,8 +315,9 @@ export const fetchOlistRunDetails = async (runId: number, eventsPage = 1, produc
|
||||
return data as OlistRunDetails;
|
||||
};
|
||||
|
||||
export const fetchProductionOrderImportData = async (): Promise<ProductionOrderImportData> => {
|
||||
const response = await authFetch('/olist/production-order-imports', { cache: 'no-store' });
|
||||
export const fetchProductionOrderImportData = async (runsPage = 1, runsPageSize = 5): Promise<ProductionOrderImportData> => {
|
||||
const params = new URLSearchParams({ runsPage: String(runsPage), runsPageSize: String(runsPageSize) });
|
||||
const response = await authFetch(`/olist/production-order-imports?${params}`, { cache: 'no-store' });
|
||||
const data = await response.json().catch(() => null);
|
||||
if (!response.ok) throw new Error(data?.error || 'Não foi possível consultar as importações de OP.');
|
||||
return data as ProductionOrderImportData;
|
||||
|
||||
Reference in New Issue
Block a user