mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
feat(core): Use filters for delete data table rows (no-changelog) (#19375)
This commit is contained in:
@@ -31,7 +31,14 @@ describe('dataStore.api', () => {
|
||||
'DELETE',
|
||||
`/projects/${projectId}/data-tables/${dataStoreId}/rows`,
|
||||
{
|
||||
ids: '1,2,3',
|
||||
filter: {
|
||||
type: 'or',
|
||||
filters: [
|
||||
{ columnName: 'id', condition: 'eq', value: 1 },
|
||||
{ columnName: 'id', condition: 'eq', value: 2 },
|
||||
{ columnName: 'id', condition: 'eq', value: 3 },
|
||||
],
|
||||
},
|
||||
},
|
||||
);
|
||||
expect(result).toBe(true);
|
||||
|
||||
@@ -190,12 +190,16 @@ export const deleteDataStoreRowsApi = async (
|
||||
rowIds: number[],
|
||||
projectId: string,
|
||||
) => {
|
||||
const filters = rowIds.map((id) => ({ columnName: 'id', condition: 'eq', value: id }));
|
||||
return await makeRestApiRequest<boolean>(
|
||||
context,
|
||||
'DELETE',
|
||||
`/projects/${projectId}/data-tables/${dataStoreId}/rows`,
|
||||
{
|
||||
ids: rowIds.join(','),
|
||||
filter: {
|
||||
type: 'or',
|
||||
filters,
|
||||
},
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user