Revert merging of server and client repository

This commit is contained in:
Elias Projahn 2021-01-16 16:15:08 +01:00
parent 2b9cff885b
commit 8c3c439409
147 changed files with 53 additions and 2113 deletions

View file

@ -0,0 +1,18 @@
use super::Backend;
use crate::database::Person;
use anyhow::Result;
impl Backend {
/// Get all available persons from the server.
pub async fn get_persons(&self) -> Result<Vec<Person>> {
let body = self.get("persons").await?;
let persons: Vec<Person> = serde_json::from_str(&body)?;
Ok(persons)
}
/// Post a new person to the server.
pub async fn post_person(&self, data: &Person) -> Result<()> {
self.post("persons", serde_json::to_string(data)?).await?;
Ok(())
}
}