[FEAT] RecordAction destroy many record (#9991)

# Introduction
Added the `RecordAction` destroy multiple record

## Repro
Select multiples `deletedRecords`, you should be able to see the
`Destroy` pinned CTA ( iso short label with the destroy one ), open
control panel and fin new CTA `Permanently delete records`


https://github.com/user-attachments/assets/31ee8738-9d61-4dec-9a1f-41bb6785e018

## TODO
- [ ] Gain granularity within tests to assert the action should be
registered only when filtering by deleted

## Conclusion
Closes https://github.com/twentyhq/core-team-issues/issues/110
This commit is contained in:
Paul Rastoin
2025-02-05 11:33:01 +01:00
committed by GitHub
parent aa003f25d9
commit 28a3f75946
12 changed files with 338 additions and 33 deletions

View File

@ -87,9 +87,12 @@ export const usePersistViewGroupRecords = () => {
async (viewGroupsToDelete: ViewGroup[]) => {
if (!viewGroupsToDelete.length) return;
return destroyManyRecords(
viewGroupsToDelete.map((viewGroup) => viewGroup.id),
const recordIdsToDestroy = viewGroupsToDelete.map(
(viewGroup) => viewGroup.id,
);
return destroyManyRecords({
recordIdsToDestroy,
});
},
[destroyManyRecords],
);