(core) Improving custom widget API. Changing destroy function signature.

Summary:
Destroy function in TableOperations was throwing error when invoked with a single
record id instead of an array. Now it returns a void type.

Also changing mapColumns function signature as it doesn't require options for a default
behavior.

Test Plan: Updated tests.

Reviewers: alexmojaki

Reviewed By: alexmojaki

Differential Revision: https://phab.getgrist.com/D3404
This commit is contained in:
Jarosław Sadziński
2022-05-05 13:42:50 +02:00
parent 1e42871cc9
commit db57815d2b
4 changed files with 14 additions and 17 deletions

View File

@@ -298,7 +298,8 @@ export class DocWorkerApi {
this._app.post('/api/docs/:docId/tables/:tableId/data/delete', canEdit, withDoc(async (activeDoc, req, res) => {
const rowIds = req.body;
const op = getTableOperations(req, activeDoc);
res.json(await op.destroy(rowIds));
await op.destroy(rowIds);
res.json(null);
}));
// Download full document