diff --git a/src/api/wishes.php b/src/api/wishes.php index 74424633..41fe2602 100644 --- a/src/api/wishes.php +++ b/src/api/wishes.php @@ -56,21 +56,25 @@ switch ($_SERVER['REQUEST_METHOD']) { $wishlist_id = $_POST['wishlist_id']; $wish_title = trim($_POST['wish_title']); - $wish_description = $_POST['wish_description'] ?: ''; + $wish_description = trim($_POST['wish_description']); $wish_url = trim($_POST['wish_url']); + $wish_priority = isset($_POST['wish_priority']) && $_POST['wish_priority'] ? $_POST['wish_priority'] : 'NULL'; - $database->query('INSERT INTO `wishes` - ( - `wishlist`, - `title`, - `description`, - `url` - ) VALUES (' - . $wishlist_id . ', - "' . $wish_title . '", - "' . $wish_description . '", - "' . $wish_url . '" - ) + $database + ->query('INSERT INTO `wishes` + ( + `wishlist`, + `title`, + `description`, + `url`, + `priority` + ) VALUES ( + ' . $wishlist_id . ', + "' . $wish_title . '", + "' . $wish_description . '", + "' . $wish_url . '", + ' . $wish_priority . ' + ) ;'); $response['data'] = array( diff --git a/src/assets/js/parts/wish-priority.js b/src/assets/js/parts/wish-priority.js new file mode 100644 index 00000000..16243546 --- /dev/null +++ b/src/assets/js/parts/wish-priority.js @@ -0,0 +1,8 @@ +$(function () { + + /** + * Priority + */ + $('.dropdown.priority').dropdown(); + +}); diff --git a/src/assets/js/wish.js b/src/assets/js/wish.js index f7868ba3..d06da9df 100644 --- a/src/assets/js/wish.js +++ b/src/assets/js/wish.js @@ -144,9 +144,4 @@ $(function () { }); }); - /** - * Priority - */ - $('.dropdown.priority').dropdown(); - }); diff --git a/src/assets/js/wishlists.js b/src/assets/js/wishlists.js index bfbfbd02..fca609b1 100644 --- a/src/assets/js/wishlists.js +++ b/src/assets/js/wishlists.js @@ -55,8 +55,6 @@ $(function () { /** Update URL */ urlParams.set('id', wishlistValue); - console.log(wishlistValue); - fetch('/src/api/url.php?url=' + window.btoa(urlParams.toString()), { method: 'GET' }) @@ -368,8 +366,8 @@ $(function () { modalWishlistWishAdd.find('[name="wishlist_id"]').val($('.ui.dropdown.wishlists').dropdown('get value')); modalWishlistWishAdd .modal({ - autoShow : true, - onApprove: function (buttonAdd) { + autoShow : true, + onApprove : function (buttonAdd) { buttonAdd.addClass('loading'); var form = $('.form.wishlist-wish-add'); diff --git a/src/pages/install.php b/src/pages/install.php index bf2e2e8d..857b2a27 100644 --- a/src/pages/install.php +++ b/src/pages/install.php @@ -31,7 +31,7 @@ switch ($step) {
= __('Welcome to the wishthis installer.') ?>
= __('wishthis needs a database to function properly. Please enter your credentials.') ?>
-