Checkbox is correctly handled with null value (and not false)

- It's better to read the comment juste below the line... 😠 (https://github.com/openfoodfoundation/openfoodnetwork/pull/3076#issuecomment-440010498)
 - Add appropriate spec so it is now correctly tested!
This commit is contained in:
Jean-Baptiste Bellet
2021-06-17 21:40:25 +02:00
parent 7008b5ec7b
commit 89ea9913e6
2 changed files with 25 additions and 1 deletions

View File

@@ -49,7 +49,7 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
'q[bill_address_firstname_start]': $scope.q?.bill_address_firstname_start,
'q[bill_address_lastname_start]': $scope.q?.bill_address_lastname_start,
# Set default checkbox values to null. See: https://github.com/openfoodfoundation/openfoodnetwork/pull/3076#issuecomment-440010498
'q[completed_at_not_null]': $scope.q?.completed_at_not_null,
'q[completed_at_not_null]': $scope.q?.completed_at_not_null || null,
'q[distributor_id_in][]': $scope.q?.distributor_id_in,
'q[order_cycle_id_in][]': $scope.q?.order_cycle_id_in,
'q[s]': $scope.sorting || 'completed_at desc',