Skip to content

Commit

Permalink
Merge pull request #179 from gabimoncha/master
Browse files Browse the repository at this point in the history
Added pickup_address field in store and constraints
  • Loading branch information
srfrnk authored Mar 6, 2018
2 parents 3edd1bc + d46a1ca commit a0a0e54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions server/controllers/constraints/need/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ module.exports = {
greaterThanOrEqualTo: -180
}
},
pickup_address: {
presence: true,
},
dropoff_latitude: {
presence: true,
numericality: {
Expand Down
4 changes: 3 additions & 1 deletion server/store/missions.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const createMission = async ({ user_id, bidId }) => {

// get neeed details
const need = await getNeed(need_id);
const { pickup_latitude, pickup_longitude, dropoff_latitude, dropoff_longitude, pickup_at, cargo_type, weight } = need;
const { pickup_latitude, pickup_longitude, pickup_address, dropoff_latitude, dropoff_longitude, pickup_at, cargo_type, weight } = need;

// get new unique id for mission
const missionId = await redis.incrAsync('next_mission_id');
Expand All @@ -54,6 +54,7 @@ const createMission = async ({ user_id, bidId }) => {
'need_id', need_id,
'pickup_latitude', pickup_latitude,
'pickup_longitude', pickup_longitude,
'pickup_address', pickup_address,
'dropoff_latitude', dropoff_latitude,
'dropoff_longitude', dropoff_longitude,
'pickup_at', pickup_at,
Expand All @@ -70,6 +71,7 @@ const createMission = async ({ user_id, bidId }) => {
time_to_dropoff,
pickup_latitude,
pickup_longitude,
pickup_address,
dropoff_latitude,
dropoff_longitude,
pickup_at,
Expand Down

0 comments on commit a0a0e54

Please sign in to comment.