3757 update frontend to show correct view count (#3967)

* Add totalCount to fetch record request

* Add totalCount to object board

* WIP Add totalCount to object table

* Update query total count on update / delete optimistic effects

* Remove console log

* Load fewer data for totalcount

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
martmull
2024-02-16 14:33:51 +01:00
committed by GitHub
parent a5ecbf7df5
commit a06b6c9078
11 changed files with 91 additions and 26 deletions

View File

@ -36,10 +36,10 @@ export const SettingsObjectItemTableRow = ({
}: SettingsObjectItemTableRowProps) => {
const theme = useTheme();
const { records } = useFindManyRecords({
const { totalCount } = useFindManyRecords({
objectNameSingular: objectItem.nameSingular,
depth: 0,
});
const { getIcon } = useIcons();
const Icon = getIcon(objectItem.icon);
@ -61,7 +61,7 @@ export const SettingsObjectItemTableRow = ({
<TableCell align="right">
{objectItem.fields.filter((field) => !field.isSystem).length}
</TableCell>
<TableCell align="right">{records.length}</TableCell>
<TableCell align="right">{totalCount}</TableCell>
<StyledActionTableCell>{action}</StyledActionTableCell>
</StyledObjectTableRow>
);