mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add a cli tool for deleting sites
Summary: This adds a `site:delete` target to `cli.sh` for deleting sites. Sites should be specified by numeric org id, and for confirmation their name also needs to be given. All the docs in the site are deleted permanently, and the workspaces, and the site, and the stripe customer (if any). Test Plan: manual Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D3015
This commit is contained in:
@@ -758,9 +758,13 @@ export class DocWorkerApi {
|
||||
const scope = getDocScope(req);
|
||||
const docId = getDocId(req);
|
||||
if (permanent) {
|
||||
const query = await this._dbManager.deleteDocument(scope);
|
||||
this._dbManager.checkQueryResult(query); // fail immediately if deletion denied.
|
||||
// Soft delete the doc first, to de-list the document.
|
||||
await this._dbManager.softDeleteDocument(scope);
|
||||
// Delete document content from storage.
|
||||
await this._docManager.deleteDoc(null, docId, true);
|
||||
// Permanently delete from database.
|
||||
const query = await this._dbManager.deleteDocument(scope);
|
||||
this._dbManager.checkQueryResult(query);
|
||||
await sendReply(req, res, query);
|
||||
} else {
|
||||
await this._dbManager.softDeleteDocument(scope);
|
||||
|
||||
Reference in New Issue
Block a user