mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 18:52:34 +08:00
Merge branch 'master' into reply-missing-postdontagree
This commit is contained in:
+16
-6
@@ -70,15 +70,25 @@ const setRole = (ctx, id, role) => {
|
||||
/**
|
||||
* transforms a specific action to a removal action on the target model.
|
||||
*/
|
||||
const actionDecrTransformer = ({ item_id, action_type, group_id }) => ({
|
||||
query: { id: item_id },
|
||||
update: {
|
||||
const actionDecrTransformer = ({ item_id, action_type, group_id }) => {
|
||||
const update = {
|
||||
$inc: {
|
||||
[`action_counts.${action_type.toLowerCase()}`]: -1,
|
||||
[`action_counts.${action_type.toLowerCase()}_${group_id.toLowerCase()}`]: -1,
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
if (group_id) {
|
||||
// If the action had a groupID, also decrement that key.
|
||||
update.$inc[
|
||||
`action_counts.${action_type.toLowerCase()}_${group_id.toLowerCase()}`
|
||||
] = -1;
|
||||
}
|
||||
|
||||
return {
|
||||
query: { id: item_id },
|
||||
update,
|
||||
};
|
||||
};
|
||||
|
||||
// delUser will delete a given user with the specified id.
|
||||
const delUser = async (ctx, id) => {
|
||||
|
||||
@@ -27,7 +27,7 @@ class DeleteMyAccount extends React.Component {
|
||||
const { cancelAccountDeletion, notify } = this.props;
|
||||
try {
|
||||
await cancelAccountDeletion();
|
||||
notify('success', t('delete_request.account_deletion_requested'));
|
||||
notify('success', t('delete_request.account_deletion_cancelled'));
|
||||
} catch (err) {
|
||||
notify('error', getErrorMessages(err));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user