responseType_,
+ withCredentials: this.configuration.withCredentials,
+ headers: localVarHeaders,
+ observe: observe,
+ reportProgress: reportProgress
+ }
+ );
+ }
+
/**
* creates a new task
* creates tasks
diff --git a/frontend/src/app/tasks/task-editor/task-editor.component.html b/frontend/src/app/tasks/task-editor/task-editor.component.html
index df5b8b8..317a467 100644
--- a/frontend/src/app/tasks/task-editor/task-editor.component.html
+++ b/frontend/src/app/tasks/task-editor/task-editor.component.html
@@ -28,5 +28,5 @@
-
+
diff --git a/frontend/src/app/tasks/task-editor/task-editor.component.ts b/frontend/src/app/tasks/task-editor/task-editor.component.ts
index 6dd4acc..7c18112 100644
--- a/frontend/src/app/tasks/task-editor/task-editor.component.ts
+++ b/frontend/src/app/tasks/task-editor/task-editor.component.ts
@@ -39,6 +39,7 @@ export class TaskEditorComponent implements OnInit {
}
submit() {
+
if(this.editorData.task != undefined) {
this.editTask()
} else {
@@ -71,6 +72,30 @@ export class TaskEditorComponent implements OnInit {
}
editTask() {
- //todo: api call
+ this.taskService.tasksTaskIDPost(this.editorData.task!.taskID, {
+ taskName: this.nameCtrl.value,
+ eta: this.etaCtrl.value,
+ startDate: this.startDate.value,
+ deadline: this.endDate.value
+ }).subscribe({
+ next: resp => {
+ this.editorData.task!.taskName = this.nameCtrl.value;
+ this.editorData.task!.eta = this.etaCtrl.value;
+ this.editorData.task!.startDate = this.startDate.value;
+ this.editorData.task!.deadline = this.endDate.value;
+ this.dialog.close(true);
+ },
+ error: err => {
+ if(err.status == 403) {
+ this.snackbar.open("No permission", "", {duration: 2000});
+ } else if(err.status == 404) {
+ this.snackbar.open("Taskgroup not found", "", {duration: 2000});
+ } else if(err.status == 409) {
+ this.snackbar.open("Task already exists", "", {duration: 2000});
+ } else {
+ this.snackbar.open("Unexpected error", "", {duration: 3000});
+ }
+ }
+ })
}
}
diff --git a/openapi.yaml b/openapi.yaml
index 3699910..2547368 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -969,6 +969,80 @@ paths:
example: "failed"
enum:
- "failed"
+ /tasks/{taskID}:
+ post:
+ security:
+ - API_TOKEN: []
+ tags:
+ - task
+ summary: edits an existing task
+ description: edits an existing task
+ parameters:
+ - name: taskID
+ in: path
+ description: internal id of task
+ required: true
+ schema:
+ type: number
+ example: 1
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/TaskFieldInfo'
+ responses:
+ 200:
+ description: Anfrage erfolgreich
+ content:
+ 'application/json':
+ schema:
+ type: object
+ $ref: '#/components/schemas/TaskEntityInfo'
+ 403:
+ description: No permission
+ content:
+ 'application/json':
+ schema:
+ type: object
+ required:
+ - status
+ properties:
+ status:
+ type: string
+ description: Status
+ example: "failed"
+ enum:
+ - "failed"
+ 404:
+ description: Taskgroup does not exist
+ content:
+ 'application/json':
+ schema:
+ type: object
+ required:
+ - status
+ properties:
+ status:
+ type: string
+ description: Status
+ example: "failed"
+ enum:
+ - "failed"
+ 409:
+ description: Task already exist
+ content:
+ 'application/json':
+ schema:
+ type: object
+ required:
+ - status
+ properties:
+ status:
+ type: string
+ description: Status
+ example: "failed"
+ enum:
+ - "failed"
components:
securitySchemes: