* replacing extract_uid usage with qs_param!(....).unwrap() usage
This commit is contained in:
parent
8e98df1d37
commit
4c92b20e74
@ -2,7 +2,7 @@ use hyper::{StatusCode, Response, Body};
|
||||
|
||||
use mysql_async::Pool;
|
||||
|
||||
use serde_json::{json, Value};
|
||||
use serde_json::json;
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
@ -13,6 +13,7 @@ use db::{
|
||||
};
|
||||
|
||||
use crate::http::set_json_body;
|
||||
use crate::qs_param;
|
||||
|
||||
|
||||
pub async fn list_channels(pool: &Pool, response: &mut Response<Body>) {
|
||||
@ -94,7 +95,7 @@ pub async fn delete_channel(pool: &Pool, response: &mut Response<Body>, params:
|
||||
use db::member::Member;
|
||||
use db::Response::*;
|
||||
|
||||
let uid = crate::http::extract_uid(¶ms);
|
||||
let uid = qs_param!(params, "id", u64).unwrap();
|
||||
let permissions = match Member::get(pool, uid).await {
|
||||
Row(user) => user.permissions,
|
||||
_ => 0
|
||||
|
Loading…
Reference in New Issue
Block a user