|
@ -331,14 +331,6 @@ impl EntityGateway for PostgresGateway { |
|
|
*/
|
|
|
*/
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
async fn change_item(&mut self, id: &ItemEntityId, item: &ItemDetail) -> Result<(), GatewayError> {
|
|
|
|
|
|
sqlx::query("update item set item = $1 where id = $2")
|
|
|
|
|
|
.bind(sqlx::types::Json(PgItemDetail::from(item.clone())))
|
|
|
|
|
|
.bind(id.0)
|
|
|
|
|
|
.execute(&self.pool).await?;
|
|
|
|
|
|
Ok(())
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async fn change_item_location(&mut self, item_id: &ItemEntityId, item_location: ItemLocation) -> Result<(), GatewayError> {
|
|
|
async fn change_item_location(&mut self, item_id: &ItemEntityId, item_location: ItemLocation) -> Result<(), GatewayError> {
|
|
|
sqlx::query("insert into item_location (item, location) values ($1, $2)")
|
|
|
sqlx::query("insert into item_location (item, location) values ($1, $2)")
|
|
|
.bind(item_id.0)
|
|
|
.bind(item_id.0)
|
|
|