Skip to content

Commit

Permalink
prevent offering from being updated with invalid hour/minute input fo…
Browse files Browse the repository at this point in the history
…r end-date.
  • Loading branch information
stopfstedt committed Oct 15, 2024
1 parent bc68b75 commit 6439adb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/ilios-common/addon/components/offering-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,11 @@ export default class OfferingForm extends Component {
}

updateDurationHours = restartableTask(async (hours) => {
// The corresponding input field passes an empty string if the input blank or invalid.
// Here, we ignore invalid input and exit early.
if ('' === hours) {
return;
}
await timeout(DEBOUNCE_DELAY);
this.addErrorDisplayFor('durationHours');
this.addErrorDisplayFor('durationMinutes');
Expand All @@ -535,6 +540,11 @@ export default class OfferingForm extends Component {
});

updateDurationMinutes = restartableTask(async (minutes) => {
// The corresponding input field passes an empty string if the input blank or invalid.
// Here, we ignore invalid input and exit early.
if ('' === minutes) {
return;
}
await timeout(DEBOUNCE_DELAY);
this.addErrorDisplayFor('durationHours');
this.addErrorDisplayFor('durationMinutes');
Expand Down

0 comments on commit 6439adb

Please sign in to comment.