Skip to content

Commit

Permalink
Merge pull request #74 from Princesso/feature-#163142355-build-out-he…
Browse files Browse the repository at this point in the history
…ader-footer-and-main-content-container

Update SQL queries
  • Loading branch information
Princesso committed Mar 28, 2019
2 parents 2718409 + 06a0abe commit 4200293
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ const createTables = async () => {
}
};

dropTable().then(res => {
console.log('All tables dropped')
createTables().then(res => {
console.log('All tables created')
});
})


export default client
4 changes: 2 additions & 2 deletions server/controllers/ParcelsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class Parcels {
if(result.rowCount === 0) {
return res.status(204).json({ "status": 204, "error": 'Only parcel owners can change order destination'})
} else if (result.rowCount >= 1) {
return res.status(200).json({"status": 200, "Message": "The destination has been changed successfully "});
return res.status(200).json({"status": 200, "Message": "The destination has been changed successfully ", "data": result.rows[0]});
}
})
.catch((error) => {
Expand All @@ -165,7 +165,7 @@ class Parcels {
if(result.rowCount === 0) {
return res.status(204).json({ "status": 204, "error": 'No such parcel'})
} else if (result.rowCount >= 1) {
res.status(200).json({"status": 200, "Message": "The current location of the order has been updated successfully "});
res.status(200).json({"status": 200, "Message": "The current location of the order has been updated successfully ", "data": result.rows[0] });
}
})
.catch((error) => {
Expand Down

0 comments on commit 4200293

Please sign in to comment.