include changes as requested

This commit is contained in:
blek 2023-12-14 19:35:13 +10:00
parent 5fab110513
commit 589ff7b040
Signed by: blek
GPG Key ID: 14546221E3595D0C
3 changed files with 2 additions and 3 deletions

View File

@ -2,7 +2,6 @@
use std::error::Error; use std::error::Error;
use redis::{Client, Commands, AsyncCommands, Connection}; use redis::{Client, Commands, AsyncCommands, Connection};
use tokio::task::JoinSet;
use crate::env::Env; use crate::env::Env;

View File

@ -1,5 +1,6 @@
use std::{collections::HashMap, net::IpAddr}; use std::{collections::HashMap, net::IpAddr};
use serde_json::json;
use warp::{reply::{Reply, json, with_status}, reject::Rejection, Filter, http::StatusCode}; use warp::{reply::{Reply, json, with_status}, reject::Rejection, Filter, http::StatusCode};
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};
use warp_real_ip::real_ip; use warp_real_ip::real_ip;
@ -106,7 +107,7 @@ pub async fn delete(state: SharedState, body: DeleteFunctionPayload, ip: Option<
file.delete(state).await; file.delete(state).await;
Ok(Box::new(json(&HashMap::<(), ()>::new()))) Ok(Box::new(json(&json!({}))))
} }
pub fn delete_f(state: SharedState) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { pub fn delete_f(state: SharedState) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {

View File

@ -48,7 +48,6 @@ pub async fn get_all(state: SharedState, ip: Option<IpAddr>) -> Result<Box<dyn R
|x| { |x| {
if let Some(owner) = x.uploader_ip { if let Some(owner) = x.uploader_ip {
if let Some(caller) = ip { if let Some(caller) = ip {
println!("{owner} {caller}");
return owner == caller return owner == caller
} }
} }