|
|
@ -12,7 +12,7 @@ pub async fn add_client( |
|
|
|
let mut clients = db.lock().await; |
|
|
|
let mut clients = db.lock().await; |
|
|
|
if clients.contains_key(&new_cli.id) { |
|
|
|
if clients.contains_key(&new_cli.id) { |
|
|
|
Ok(warp::reply::json( |
|
|
|
Ok(warp::reply::json( |
|
|
|
&RawMsg("Already exist".to_string()).into_message() |
|
|
|
&RawMsg("Already exist".to_string()).as_message() |
|
|
|
)) |
|
|
|
)) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
clients.insert( |
|
|
|
clients.insert( |
|
|
@ -20,7 +20,7 @@ pub async fn add_client( |
|
|
|
UClient::new(new_cli.into_owned()) |
|
|
|
UClient::new(new_cli.into_owned()) |
|
|
|
); |
|
|
|
); |
|
|
|
Ok(warp::reply::json( |
|
|
|
Ok(warp::reply::json( |
|
|
|
&RawMsg("Added".to_string()).into_message() |
|
|
|
&RawMsg("Added".to_string()).as_message() |
|
|
|
)) |
|
|
|
)) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -42,7 +42,7 @@ pub async fn get_jobs( |
|
|
|
|
|
|
|
|
|
|
|
pub async fn set_jobs( |
|
|
|
pub async fn set_jobs( |
|
|
|
uid: Option<Uuid>, |
|
|
|
uid: Option<Uuid>, |
|
|
|
msg: Message<'_, JobStorageWrapper>, |
|
|
|
msg: Message<'_, CollectionWrapper<JobStorage>>, |
|
|
|
db: Storage) -> Result<impl Reply, Rejection> |
|
|
|
db: Storage) -> Result<impl Reply, Rejection> |
|
|
|
{ |
|
|
|
{ |
|
|
|
let mut clients = db.lock().await; |
|
|
|
let mut clients = db.lock().await; |
|
|
@ -64,6 +64,6 @@ pub async fn listing(db: Storage) -> Result<impl Reply, Rejection> { |
|
|
|
result.push(cli.client_info.clone()); |
|
|
|
result.push(cli.client_info.clone()); |
|
|
|
} |
|
|
|
} |
|
|
|
Ok(warp::reply::json( |
|
|
|
Ok(warp::reply::json( |
|
|
|
&Message::new_owned(result) |
|
|
|
&CollectionWrapper(result).as_message() |
|
|
|
)) |
|
|
|
)) |
|
|
|
} |
|
|
|
} |