work
This commit is contained in:
parent
09a3f096c7
commit
288f193754
7 changed files with 53 additions and 17 deletions
|
@ -1,12 +1,15 @@
|
|||
use crate::db;
|
||||
use crate::templates;
|
||||
use tide::prelude::*;
|
||||
|
||||
const USER: &str = "foosinn";
|
||||
|
||||
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")
|
||||
let my = db::Device::for_user(USER)
|
||||
.fetch_all(&request.state().pool)
|
||||
.await
|
||||
.map_err(|err| dbg!(err))?;
|
||||
|
@ -16,3 +19,13 @@ pub async fn index(request: crate::Request) -> tide::Result {
|
|||
.map_err(|err| dbg!(err))?;
|
||||
Ok(templates::IndexTemplate::new(my, unassinged).into())
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct RegisterForm {
|
||||
macaddr: String,
|
||||
}
|
||||
|
||||
pub async fn register(mut request: crate::Request) -> tide::Result {
|
||||
let form: RegisterForm = request.body_form().await?;
|
||||
unimplemented!();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue