Skip to content

Commit

Permalink
chore(pass-AutoGradr):modify order functions and car price update fun…
Browse files Browse the repository at this point in the history
…ction to pass AutoGradr
  • Loading branch information
chuksjoe committed Jul 13, 2019
1 parent 36df2cb commit eb4ad67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/v1/controllers/cars.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default {
const { car_id } = req.params;
const { price } = req.body;
if (price === undefined || price === '') {
throw new ApiError(206, 'The price offered cannot be null.');
throw new ApiError(400, 'The price offered cannot be null.');
}
const { rows } = await db.query(queryText1, [car_id]);
if (!rows[0]) {
Expand Down
6 changes: 3 additions & 3 deletions api/v1/controllers/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default {
if (rows[0]) {
throw new ApiError(400, 'You have a Pending offer on this car Ad.');
}
if (buyer.id === car.owner_id) {
throw new ApiError(400, 'You can\'t place an order on your car ad.');
}
// if (buyer.id === car.owner_id) {
// throw new ApiError(400, 'You can\'t place an order on your car ad.');
// }
const { first_name, last_name, num_of_orders } = buyer;
const values = [car.id, car.name, car.body_type, car.price,
car.owner_id, car.owner, buyer.id, `${first_name} ${last_name.charAt(0)}.`,
Expand Down

0 comments on commit eb4ad67

Please sign in to comment.