Unify records model and add notification center
This commit is contained in:
@@ -150,7 +150,7 @@ export function DirView({
|
||||
onRowPress = null,
|
||||
onRefresh = null,
|
||||
showHeader = true,
|
||||
showSummary = true,
|
||||
showSummary = false,
|
||||
density = 'comfortable',
|
||||
striped = false
|
||||
}) {
|
||||
@@ -199,12 +199,14 @@ export function DirView({
|
||||
setLoading(true);
|
||||
setError('');
|
||||
try {
|
||||
const offset = (currentPage - 1) * pageSize;
|
||||
const sortBy = orderBy ? [{ field: orderBy, direction: order }] : [];
|
||||
const filterBy = effectiveSearchTerm ? { search: effectiveSearchTerm } : {};
|
||||
const query = {
|
||||
page: currentPage,
|
||||
pageSize,
|
||||
search: effectiveSearchTerm,
|
||||
orderBy,
|
||||
order
|
||||
offset,
|
||||
page_size: pageSize,
|
||||
sort_by: sortBy,
|
||||
filter_by: filterBy
|
||||
};
|
||||
|
||||
const [recordResult, summaryResult] = await Promise.all([
|
||||
@@ -213,8 +215,8 @@ export function DirView({
|
||||
]);
|
||||
|
||||
if (!cancelled) {
|
||||
setRecords(recordResult.records || []);
|
||||
setTotalRecords(recordResult.totalRecords || 0);
|
||||
setRecords(recordResult.rows || []);
|
||||
setTotalRecords(recordResult.total || 0);
|
||||
setSummary(summaryResult || null);
|
||||
}
|
||||
} catch (loadError) {
|
||||
|
||||
Reference in New Issue
Block a user