recover Account
This commit is contained in:
parent
b70527032e
commit
39475fdb47
1 changed files with 17 additions and 0 deletions
|
@ -42,6 +42,23 @@ export const getAccounts: Act = {
|
|||
}
|
||||
};
|
||||
|
||||
export const recoverAccount: Act = {
|
||||
state: STATE.client,
|
||||
right: PERMISSIONS.CAN_USE_API | PERMISSIONS.EDIT_USERS,
|
||||
data: {
|
||||
accID: "number"
|
||||
},
|
||||
func: async (client: Client, data: any, aws: (code: string, data: any) => void) => {
|
||||
let req = await update(accounts)
|
||||
.set(accounts.deleted, false)
|
||||
.set(accounts.deletedTime, 0)
|
||||
.where(eq(accounts.accID, data.accID))
|
||||
.query(db);
|
||||
if(req.affectedRows > 0) aws("ok", "");
|
||||
else aws("error", act_error.ACCOUNT_NOT_EXISTS)
|
||||
}
|
||||
}
|
||||
|
||||
export const setPermissions: Act = {
|
||||
state: STATE.client,
|
||||
right: PERMISSIONS.CAN_USE_API | PERMISSIONS.EDIT_RIGHTS,
|
||||
|
|
Loading…
Reference in a new issue