mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
fix(edgejobs): validate date when saving job in basic configuration (#7048)
This commit is contained in:
parent
4fb1880ddc
commit
005c48b1ad
1 changed files with 4 additions and 1 deletions
|
@ -59,7 +59,10 @@ export class EdgeJobFormController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.formValues.cronMethod === 'basic') {
|
if (this.formValues.cronMethod === 'basic') {
|
||||||
if (!this.model.Recurring) {
|
if (!this.model.Recurring && (this.formValues.datetime === undefined || !this.formValues.datetime.isValid())) {
|
||||||
|
this.state.formValidationError = 'Schedule date must not be empty';
|
||||||
|
return;
|
||||||
|
} else if (!this.model.Recurring) {
|
||||||
this.model.CronExpression = datetimeToCron(this.formValues.datetime);
|
this.model.CronExpression = datetimeToCron(this.formValues.datetime);
|
||||||
} else {
|
} else {
|
||||||
this.model.CronExpression = this.formValues.scheduleValue.cron;
|
this.model.CronExpression = this.formValues.scheduleValue.cron;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue