mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-27 12:17:24 +01:00
Move crates to toplevel directory
This commit is contained in:
parent
d16961efa8
commit
0ffe68e04f
127 changed files with 15 additions and 13 deletions
|
|
@ -1,17 +0,0 @@
|
|||
use crate::{Client, Result};
|
||||
use musicus_database::Instrument;
|
||||
|
||||
impl Client {
|
||||
/// Get all available instruments from the server.
|
||||
pub async fn get_instruments(&self) -> Result<Vec<Instrument>> {
|
||||
let body = self.get("instruments").await?;
|
||||
let instruments: Vec<Instrument> = serde_json::from_str(&body)?;
|
||||
Ok(instruments)
|
||||
}
|
||||
|
||||
/// Post a new instrument to the server.
|
||||
pub async fn post_instrument(&self, data: &Instrument) -> Result<()> {
|
||||
self.post("instruments", serde_json::to_string(data)?).await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue