Added Priority Selector
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { BackendService, Task } from '../services/backend.service';
|
||||
import { BackendService, Task, Priority } from '../services/backend.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-task-form',
|
||||
@@ -11,6 +11,7 @@ export class TaskFormComponent implements OnInit {
|
||||
|
||||
public title: string;
|
||||
public content: string;
|
||||
public prio: Priority;
|
||||
|
||||
@Input()
|
||||
public task: Task;
|
||||
@@ -22,6 +23,7 @@ export class TaskFormComponent implements OnInit {
|
||||
if (this.task !== null && this.task !== undefined) {
|
||||
this.title = this.task.title;
|
||||
this.content = this.task.content;
|
||||
this.prio = this.task.priority;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +31,7 @@ export class TaskFormComponent implements OnInit {
|
||||
if (this.task !== null && this.task !== undefined) {
|
||||
this.task.title = this.title;
|
||||
this.task.content = this.content;
|
||||
this.task.priority = this.prio;
|
||||
this.backendService.putTask(this.task).subscribe(response => {
|
||||
if (response.status > 399) {
|
||||
alert('Fehler');
|
||||
|
||||
Reference in New Issue
Block a user