Browse Source

don't store fedtomag twice

pbs
jake 4 years ago
parent
commit
bfa3a93bd6
  1. 4
      src/entity/gateway/postgres/postgres.rs

4
src/entity/gateway/postgres/postgres.rs

@ -292,10 +292,6 @@ impl EntityGateway for PostgresGateway {
}
async fn feed_mag(&mut self, mag_item_id: &ItemEntityId, tool_item_id: &ItemEntityId) {
sqlx::query("insert into item_location (item, location) values ($1, $2);")
.bind(tool_item_id.0)
.bind(sqlx::types::Json(PgItemLocationDetail::from(ItemLocation::FedToMag {mag: *mag_item_id})))
.execute(&self.pool).await.unwrap();
sqlx::query("insert into mag_modifier (mag, modifier) values ($1, $2);")
.bind(mag_item_id.0)
.bind(sqlx::types::Json(PgMagModifierDetail::from(mag::MagModifier::FeedMag{food: *tool_item_id})))

Loading…
Cancel
Save