Skip to content

Commit

Permalink
addd mainImageUrl to picture list
Browse files Browse the repository at this point in the history
  • Loading branch information
arytonhoi committed Apr 24, 2020
1 parent 96f8d03 commit 4de9dba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions react-client/src/reducers/BuildingReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,19 @@ const buildingReducer = (state = initialState, action) => {
}

case FIND_ALL_BUILDINGS:
action.buildings.map(building => building.pictures.push(building.mainImageUrl))
console.log(action.buildings)
return {
...state,
buildings: action.buildings
}

case FIND_BUILDING_BY_ID:
let picture = {
url: action.building.mainImageUrl
}
action.building.pictures.push(picture)
console.log(action.building)
return {
...state,
building: action.building
Expand Down

0 comments on commit 4de9dba

Please sign in to comment.