mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-04-20 06:54:46 +00:00
implement no-content response
This commit is contained in:
parent
c8298b7bfa
commit
5a62af6319
4 changed files with 64 additions and 18 deletions
|
@ -49,35 +49,35 @@ fn read(_state : &mut State, id : u64) -> Success<User>
|
|||
}
|
||||
|
||||
#[rest_create(Users)]
|
||||
fn create(_state : &mut State, body : User) -> Success<()>
|
||||
fn create(_state : &mut State, body : User) -> NoContent
|
||||
{
|
||||
info!("Created User: {}", body.username);
|
||||
().into()
|
||||
}
|
||||
|
||||
#[rest_update_all(Users)]
|
||||
fn update_all(_state : &mut State, body : Vec<User>) -> Success<()>
|
||||
fn update_all(_state : &mut State, body : Vec<User>) -> NoContent
|
||||
{
|
||||
info!("Changing all Users to {:?}", body.into_iter().map(|u| u.username).collect::<Vec<String>>());
|
||||
().into()
|
||||
}
|
||||
|
||||
#[rest_update(Users)]
|
||||
fn update(_state : &mut State, id : u64, body : User) -> Success<()>
|
||||
fn update(_state : &mut State, id : u64, body : User) -> NoContent
|
||||
{
|
||||
info!("Change User {} to {}", id, body.username);
|
||||
().into()
|
||||
}
|
||||
|
||||
#[rest_delete_all(Users)]
|
||||
fn delete_all(_state : &mut State) -> Success<()>
|
||||
fn delete_all(_state : &mut State) -> NoContent
|
||||
{
|
||||
info!("Delete all Users");
|
||||
().into()
|
||||
}
|
||||
|
||||
#[rest_delete(Users)]
|
||||
fn delete(_state : &mut State, id : u64) -> Success<()>
|
||||
fn delete(_state : &mut State, id : u64) -> NoContent
|
||||
{
|
||||
info!("Delete User {}", id);
|
||||
().into()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue