DocApi: Implement DELETE on columns (#601) (#640)

* Factorize generateDocAndUrl
* Add describe for regrouping /records
This commit is contained in:
Florent
2023-08-24 14:33:53 +02:00
committed by GitHub
parent 9dfebefc9b
commit ee31764b83
3 changed files with 157 additions and 99 deletions

View File

@@ -746,6 +746,17 @@ export class DocWorkerApi {
})
);
this._app.delete('/api/docs/:docId/tables/:tableId/columns/:colId', canEdit,
withDoc(async (activeDoc, req, res) => {
const {tableId, colId} = req.params;
const actions = [ [ 'RemoveColumn', tableId, colId ] ];
await handleSandboxError(tableId, [colId],
activeDoc.applyUserActions(docSessionFromRequest(req), actions)
);
res.json(null);
})
);
// Add a new webhook and trigger
this._app.post('/api/docs/:docId/webhooks', isOwner, validate(WebhookSubscribeCollection),
withDoc(async (activeDoc, req, res) => {