Hello,
I try to make a function that will update a customer
So far I have this :
#[put("/<customer>" )]
fn change_data_customer(conn: DbConn, customer : Customer) -> Json<Customer>{
let result = diesel::update(customer::table.find(customer:columns:id))
.set(&customer)
.get_result(&*conn)
.unwrap();
Json(result)
}
but now I see these error messages :
Checking payme v0.1.0 (/home/roelof/payme)
error[E0433]: failed to resolve: use of undeclared type or module `columns`
--> src/main.rs:85:61
|
error[E0277]: the trait bound `Customer: rocket::request::FromParam<'_>` is not satisfied
--> src/main.rs:84:39
|
84 | fn change_data_customer(conn: DbConn, customer : Customer) -> Json<Customer>{
| ^^^^^^^^^^^^^^^^^^^ the trait `rocket::request::FromParam<'_>` is not implemented for `Customer`
error[E0277]: the trait bound `&Customer: diesel::query_builder::AsChangeset` is not satisfied
--> src/main.rs:86:11
|
86 | .set(&customer)
| ^^^^^^^^^ the trait `diesel::query_builder::AsChangeset` is not implemented for `&Customer`
error: aborting due to 3 previous errors