issue-52 #63

Merged
sebastian merged 2 commits from issue-52 into master 2023-11-13 19:44:12 +01:00
2 changed files with 6 additions and 2 deletions

View File

@ -75,6 +75,9 @@ public class ScheduleController {
if(scheduleFieldInfo instanceof BasicScheduleFieldInfo) { if(scheduleFieldInfo instanceof BasicScheduleFieldInfo) {
ServiceResult<AbstractSchedule> scheduleResult = taskScheduleService.scheduleBasic(permissionResult.getResult(), (BasicScheduleFieldInfo) scheduleFieldInfo); ServiceResult<AbstractSchedule> scheduleResult = taskScheduleService.scheduleBasic(permissionResult.getResult(), (BasicScheduleFieldInfo) scheduleFieldInfo);
if(scheduleResult.getExitCode() == ServiceExitCode.INVALID_OPERATION) {
return ResponseEntity.status(400).body(new SimpleStatusResponse("failed"));
}
return ResponseEntity.ok(scheduleResult.getResult().toScheduleInfo()); return ResponseEntity.ok(scheduleResult.getResult().toScheduleInfo());
} else if(scheduleFieldInfo instanceof AdvancedScheduleFieldInfo) { } else if(scheduleFieldInfo instanceof AdvancedScheduleFieldInfo) {
ServiceResult<AbstractSchedule> scheduleResult = taskScheduleService.scheduleAdvanced(permissionResult.getResult(), (AdvancedScheduleFieldInfo) scheduleFieldInfo); ServiceResult<AbstractSchedule> scheduleResult = taskScheduleService.scheduleAdvanced(permissionResult.getResult(), (AdvancedScheduleFieldInfo) scheduleFieldInfo);

View File

@ -9,6 +9,7 @@ import {
} from "../../../api"; } from "../../../api";
import {MatSnackBar} from "@angular/material/snack-bar"; import {MatSnackBar} from "@angular/material/snack-bar";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import * as moment from "moment";
@Component({ @Component({
selector: 'app-basic-scheduler', selector: 'app-basic-scheduler',
@ -36,7 +37,7 @@ export class BasicSchedulerComponent implements OnChanges{
if(this.task != undefined) { if(this.task != undefined) {
if(this.scheduleEntityInfo == undefined) { if(this.scheduleEntityInfo == undefined) {
this.scheduleService.schedulesTaskIDBasicPut(this.task.taskID, { this.scheduleService.schedulesTaskIDBasicPut(this.task.taskID, {
scheduleDate: this.dateCtrl.value scheduleDate: moment(this.dateCtrl.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ')
}).subscribe({ }).subscribe({
next: resp => { next: resp => {
this.scheduleEmitter.emit(resp as BasicScheduleInfo); this.scheduleEmitter.emit(resp as BasicScheduleInfo);
@ -44,7 +45,7 @@ export class BasicSchedulerComponent implements OnChanges{
}) })
} else { } else {
this.scheduleService.schedulesScheduleIDBasicPost(this.scheduleEntityInfo!.scheduleID, { this.scheduleService.schedulesScheduleIDBasicPost(this.scheduleEntityInfo!.scheduleID, {
scheduleDate: this.dateCtrl.value scheduleDate: moment(this.dateCtrl.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ')
}).subscribe({ }).subscribe({
next: resp => { next: resp => {
this.router.navigateByUrl("/taskgroups/" + this.taskgroup!.taskgroupID + "/tasks/" + this.task!.taskID); this.router.navigateByUrl("/taskgroups/" + this.taskgroup!.taskgroupID + "/tasks/" + this.task!.taskID);