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:
@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user