work
This commit is contained in:
parent
7100621f5e
commit
09a3f096c7
8 changed files with 154 additions and 115 deletions
18
src/routes.rs
Normal file
18
src/routes.rs
Normal file
|
@ -0,0 +1,18 @@
|
|||
use crate::db;
|
||||
use crate::templates;
|
||||
|
||||
pub async fn healthz(_request: crate::Request) -> tide::Result {
|
||||
Ok("ok".into())
|
||||
}
|
||||
|
||||
pub async fn index(request: crate::Request) -> tide::Result {
|
||||
let my = db::Entry::for_user("foosinn")
|
||||
.fetch_all(&request.state().pool)
|
||||
.await
|
||||
.map_err(|err| dbg!(err))?;
|
||||
let unassinged = db::AliveDevice::unassinged()
|
||||
.fetch_all(&request.state().pool)
|
||||
.await
|
||||
.map_err(|err| dbg!(err))?;
|
||||
Ok(templates::IndexTemplate::new(my, unassinged).into())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue