Merging cargo fixes from db-interface

This commit is contained in:
shockrah 2020-11-17 23:47:30 -08:00
commit 159262a1f6
5 changed files with 430 additions and 378 deletions

785
server-api/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -4,6 +4,7 @@ version = "0.1.0"
authors = ["shockrah <alejandros714@protonmail.com>"]
edition = "2018"
[workspace]
[dependencies]
tokio = { version = "0.2", features=["full"] }
hyper = "0.13"

View File

@ -94,6 +94,9 @@ impl FromDB<Channel, Integer> for Channel {
Err(_) => Response::Other(sql_err!("Member::FromDB::delete Listen i dont know either"))
}
}
else {
return Response::Other(no_conn!("Member::FromDB::delete"))
}
}
async fn filter(p: &Pool, kind: Integer) -> Response<Channel> {

View File

@ -1,3 +1,4 @@
extern crate db;
extern crate chrono;
extern crate clap;
extern crate dotenv;

View File

@ -18,21 +18,3 @@ pub fn hyper_resp() -> hyper::Response<hyper::Body> {
}
#[cfg(test)]
pub async fn tmp_channel_params(p: &mysql_async::Pool, chan_name: &'static str) -> db::channels::Channel {
use db::channels::{Channel, TEXT_CHANNEL};
use mysql_async::{params, prelude::Queryable};
let conn = p.get_conn().await.unwrap();
let _ = conn.prep_exec(
"INSERT INTO channels (name, description, kind) VALUES (:name, :description, :kind)",
params!{"name" => chan_name, "kind" => 0, "description" => "no description for testing"}).await;
Channel {
id: 0,
name: chan_name.into(),
kind: TEXT_CHANNEL,
description: Some("no description for testing".into())
}
}