so bug was using AND instead of comma in UPDATE query. rookie mistake
This commit is contained in:
parent
4d2b01f961
commit
2114912305
1 changed files with 1 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ pub async fn cmd_op(bot: Bot, msg: Message, db: DbPool) -> HandlerResult {
|
||||||
if let Some(tg_user) = msg.from() {
|
if let Some(tg_user) = msg.from() {
|
||||||
if admins == 0 {
|
if admins == 0 {
|
||||||
let user = find_or_create_user(&db, tg_user).await?;
|
let user = find_or_create_user(&db, tg_user).await?;
|
||||||
sqlx::query("UPDATE user SET can_download = 1 AND is_admin = 1 WHERE id = $1;")
|
sqlx::query("UPDATE user SET can_download = 1, is_admin = 1 WHERE id = $1;")
|
||||||
.bind(user.id)
|
.bind(user.id)
|
||||||
.execute(&db).await?;
|
.execute(&db).await?;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue