feat(core): Use filters for delete data table rows (no-changelog) (#19375)

This commit is contained in:
Daria
2025-09-11 10:31:27 +03:00
committed by GitHub
parent 6dd7797c39
commit b147709189
14 changed files with 384 additions and 138 deletions

View File

@@ -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);

View File

@@ -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,
},
},
);
};