changeViewable
This commit is contained in:
parent
a6a59fa3fa
commit
b28ac9c901
1 changed files with 20 additions and 0 deletions
|
@ -91,6 +91,26 @@ export const changePassword: Act = {
|
|||
}
|
||||
};
|
||||
|
||||
export const changeViewable: Act = {
|
||||
state: STATE.client,
|
||||
right: PERMISSIONS.CAN_USE_API,
|
||||
data: {
|
||||
viewable: "boolean"
|
||||
},
|
||||
func: async (client: Client, data: any, aws: (code: string, data: any) => void) => {
|
||||
let req = await update(accounts)
|
||||
.set(accounts.viewable, data.viewable)
|
||||
.where(eq(accounts.accID, client.accID))
|
||||
.query(db);
|
||||
if (req.affectedRows > 0) {
|
||||
aws("ok", "");
|
||||
} else {
|
||||
client.suspect();
|
||||
aws("error", "existence");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const createRoom: Act = {
|
||||
state: STATE.client,
|
||||
right: PERMISSIONS.CAN_USE_API,
|
||||
|
|
Loading…
Reference in a new issue