mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Delete my account button
Summary: Adding new "Delete my account" button to the profile page that allows users to remove completely their accounts as long as they don't own any team site. Test Plan: Added Reviewers: georgegevoian, paulfitz Reviewed By: georgegevoian, paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D4037
This commit is contained in:
@@ -177,7 +177,7 @@ export class ApiServer {
|
||||
return sendReply(req, res, query);
|
||||
}));
|
||||
|
||||
// // DELETE /api/orgs/:oid
|
||||
// DELETE /api/orgs/:oid
|
||||
// Delete the specified org and all included workspaces and docs.
|
||||
this._app.delete('/api/orgs/:oid', expressWrap(async (req, res) => {
|
||||
const org = getOrgKey(req);
|
||||
|
||||
@@ -837,7 +837,7 @@ export class HomeDBManager extends EventEmitter {
|
||||
}
|
||||
await this._connection.transaction(async manager => {
|
||||
const user = await manager.findOne(User, {where: {id: userIdToDelete},
|
||||
relations: ["logins", "personalOrg"]});
|
||||
relations: ["logins", "personalOrg", "prefs"]});
|
||||
if (!user) { throw new ApiError('user not found', 404); }
|
||||
if (name) {
|
||||
if (user.name !== name) {
|
||||
@@ -853,6 +853,7 @@ export class HomeDBManager extends EventEmitter {
|
||||
.from('group_users')
|
||||
.where('user_id = :userId', {userId: userIdToDelete})
|
||||
.execute();
|
||||
|
||||
await manager.delete(User, userIdToDelete);
|
||||
});
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user