-* Removing ugle tuple indexing with some cleaner binds
- Removing warning of unused var + Adding 404 response to /badge/update/name when the badge_id isn't real
This commit is contained in:
@@ -100,7 +100,9 @@ pub async fn update_name(p: &Pool, response: &mut Response<Body>, params: HashMa
|
||||
set_json_body(response, json!({"badge-update": payload}));
|
||||
}
|
||||
},
|
||||
Ok(false) => {},
|
||||
Ok(false) => {
|
||||
*response.status_mut() = StatusCode::NOT_FOUND;
|
||||
},
|
||||
Err(e) => {
|
||||
eprintln!("[HTTP][ERROR] /badges/update/name {}", e);
|
||||
*response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR;
|
||||
@@ -115,9 +117,8 @@ pub async fn update_name(p: &Pool, response: &mut Response<Body>, params: HashMa
|
||||
pub async fn delete(p: &Pool, response: &mut Response<Body>, params: HashMap<String, String>) {
|
||||
if let Some(id) = qs_param!(params, "badge_id", u64) {
|
||||
match db::badges::delete(p, id).await {
|
||||
Ok(id) => {
|
||||
Ok(_id) => {
|
||||
// TODO: add rtc notification here
|
||||
println!("TODO remove me at some point {}", id);
|
||||
},
|
||||
Err(e) => {
|
||||
eprintln!("[HTTP][ERROR] /badge/delete {}", e);
|
||||
|
||||
Reference in New Issue
Block a user