Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/util/DBUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static function addDetail($db, $detail) {
. 'VALUES (:name, :shortDesc, :longDesc, :imageURL, :phone, :website, :cost, :email)';
$stmt = $db->prepare($query);

$email = !empty($detail['email']) ? $detail['email'] : '';
// Bind the Parameters
$stmt->bindParam(':name', $detail['name'], \PDO::PARAM_STR);
$stmt->bindParam(':shortDesc', $detail['shortDesc'], \PDO::PARAM_STR);
Expand All @@ -62,7 +63,7 @@ public static function addDetail($db, $detail) {
$stmt->bindParam(':phone', $detail['phone'], \PDO::PARAM_STR);
$stmt->bindParam(':website', $detail['website'], \PDO::PARAM_STR);
$stmt->bindParam(':cost', $detail['cost'], \PDO::PARAM_INT);
$stmt->bindParam(':email', $detail['email'], \PDO::PARAM_STR);
$stmt->bindParam(':email', $email, \PDO::PARAM_STR);
$stmt->execute();

$detailId = $db->getLastInsertId();
Expand Down
10 changes: 7 additions & 3 deletions public_html/pages/javascript/destinations.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,13 @@ evnApp.controller('EditDestCtrl', function EditDestCtrl(
// Update the event if we have a detailId
if (detailId) {
$http.post('/adminApi/updateDest',
{'dest': $scope.dest});
$scope.uploadDestImages(detailId);
$scope.$parent.getDestinations('name', 'ASC');
{'dest': $scope.dest})
.then(function(response) {
$scope.uploadDestImages(detailId);
$scope.$parent.getDestinations('name', 'ASC');
}).catch(function(reason) {
console.log(reason);
});
} else {
// Add a new event
$http.post('/adminApi/addDest',
Expand Down