This commit is contained in:
jake 2020-11-12 23:47:21 -07:00
parent a25d400624
commit 9c91df6d2e

View File

@ -450,7 +450,9 @@ impl EntityGateway for PostgresGateway {
let entity = sqlx::query_as::<_, PgItemWithLocation>("select item.id, item.item, item_location.location from item join item_location on item.id = item_location.item where id = $1") let entity = sqlx::query_as::<_, PgItemWithLocation>("select item.id, item.item, item_location.location from item join item_location on item.id = item_location.item where id = $1")
.bind(item) .bind(item)
.fetch_one(&self.pool).await .fetch_one(&self.pool).await
.map(|item| item.into())?; .map(|item| item.into())
.map(|item| self.apply_item_modifications(item))?
.await;
real_inventory.push(InventoryItemEntity::Individual(entity)); real_inventory.push(InventoryItemEntity::Individual(entity));
}, },
PgInventoryItemEntity::Stacked(items) => { PgInventoryItemEntity::Stacked(items) => {
@ -459,7 +461,9 @@ impl EntityGateway for PostgresGateway {
stacked_item.push(sqlx::query_as::<_, PgItemWithLocation>("select item.id, item.item, item_location.location from item join item_location on item.id = item_location.item where id = $1") stacked_item.push(sqlx::query_as::<_, PgItemWithLocation>("select item.id, item.item, item_location.location from item join item_location on item.id = item_location.item where id = $1")
.bind(s_item) .bind(s_item)
.fetch_one(&self.pool).await .fetch_one(&self.pool).await
.map(|item| item.into())?) .map(|item| item.into())
.map(|item| self.apply_item_modifications(item))?
.await)
} }
real_inventory.push(InventoryItemEntity::Stacked(stacked_item)); real_inventory.push(InventoryItemEntity::Stacked(stacked_item));
} }
@ -482,7 +486,9 @@ impl EntityGateway for PostgresGateway {
let entity = sqlx::query_as::<_, PgItemWithLocation>("select item.id, item.item, item_location.location from item join item_location on item.id = item_location.item where id = $1") let entity = sqlx::query_as::<_, PgItemWithLocation>("select item.id, item.item, item_location.location from item join item_location on item.id = item_location.item where id = $1")
.bind(item) .bind(item)
.fetch_one(&self.pool).await .fetch_one(&self.pool).await
.map(|item| item.into())?; .map(|item| item.into())
.map(|item| self.apply_item_modifications(item))?
.await;
real_bank.push(BankItemEntity::Individual(entity)); real_bank.push(BankItemEntity::Individual(entity));
}, },
PgInventoryItemEntity::Stacked(items) => { PgInventoryItemEntity::Stacked(items) => {
@ -491,7 +497,9 @@ impl EntityGateway for PostgresGateway {
stacked_item.push(sqlx::query_as::<_, PgItemWithLocation>("select item.id, item.item, item_location.location from item join item_location on item.id = item_location.item where id = $1") stacked_item.push(sqlx::query_as::<_, PgItemWithLocation>("select item.id, item.item, item_location.location from item join item_location on item.id = item_location.item where id = $1")
.bind(s_item) .bind(s_item)
.fetch_one(&self.pool).await .fetch_one(&self.pool).await
.map(|item| item.into())?) .map(|item| item.into())
.map(|item| self.apply_item_modifications(item))?
.await)
} }
real_bank.push(BankItemEntity::Stacked(stacked_item)); real_bank.push(BankItemEntity::Stacked(stacked_item));
} }