From 42534ffcb3fb47fcb99b168fcd24a9b5739ae14f Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 24 Jan 2022 22:09:30 +0100 Subject: [PATCH] Service duration values shorter than 5 minutes should be acceptable via the services page (#1110). --- application/controllers/Services.php | 1 + assets/js/pages/services.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/application/controllers/Services.php b/application/controllers/Services.php index d2f228d0..2468bff3 100644 --- a/application/controllers/Services.php +++ b/application/controllers/Services.php @@ -62,6 +62,7 @@ class Services extends EA_Controller { script_vars([ 'user_id' => $user_id, 'role_slug' => $role_slug, + 'event_minimum_duration' => EVENT_MINIMUM_DURATION, ]); html_vars([ diff --git a/assets/js/pages/services.js b/assets/js/pages/services.js index 4d39938a..8936082c 100644 --- a/assets/js/pages/services.js +++ b/assets/js/pages/services.js @@ -241,7 +241,7 @@ App.Pages.Services = (function () { } // Validate the duration. - if (Number($duration.val()) < 5) { + if (Number($duration.val()) < vars('event_minimum_duration')) { $duration.addClass('is-invalid'); throw new Error(lang('invalid_duration')); }