Add missing methods to backend-service
This commit is contained in:
parent
ef23aa2e26
commit
85f8cd9038
@ -9,6 +9,8 @@ export class BackendService {
|
|||||||
|
|
||||||
constructor(private httpClient: HttpClient) {}
|
constructor(private httpClient: HttpClient) {}
|
||||||
|
|
||||||
|
|
||||||
|
// Tasks
|
||||||
public getTasks(): Observable<HttpResponse<ScrumTask[]>> {
|
public getTasks(): Observable<HttpResponse<ScrumTask[]>> {
|
||||||
const url = `${environment.apiUrl}/tasks`;
|
const url = `${environment.apiUrl}/tasks`;
|
||||||
return this.httpClient.get<ScrumTask[]>(url, { observe: 'response' });
|
return this.httpClient.get<ScrumTask[]>(url, { observe: 'response' });
|
||||||
@ -35,8 +37,7 @@ export class BackendService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Userstories
|
||||||
|
|
||||||
public getUserstories(): Observable<HttpResponse<ScrumUserstory[]>> {
|
public getUserstories(): Observable<HttpResponse<ScrumUserstory[]>> {
|
||||||
const url = `${environment.apiUrl}/userstories`;
|
const url = `${environment.apiUrl}/userstories`;
|
||||||
return this.httpClient.get<ScrumUserstory[]>(url, { observe: 'response' });
|
return this.httpClient.get<ScrumUserstory[]>(url, { observe: 'response' });
|
||||||
@ -62,6 +63,140 @@ export class BackendService {
|
|||||||
return this.httpClient.delete(url, {observe: 'response'});
|
return this.httpClient.delete(url, {observe: 'response'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Sprints
|
||||||
|
public getSprints(): Observable<HttpResponse<ScrumSprint[]>> {
|
||||||
|
const url = `${environment.apiUrl}/sprints`;
|
||||||
|
return this.httpClient.get<ScrumSprint[]>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public getSprint(id: number): Observable<HttpResponse<ScrumSprint>> {
|
||||||
|
const url = `${environment.apiUrl}/sprints/${id}`;
|
||||||
|
return this.httpClient.get<ScrumSprint>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public postSprint(sprint: ScrumSprint): Observable<HttpResponse<ScrumSprint>> {
|
||||||
|
const url = `${environment.apiUrl}/sprints`;
|
||||||
|
return this.httpClient.post<ScrumSprint>(url, sprint, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public putSprint(sprint: ScrumSprint): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/sprints/${sprint.id}`;
|
||||||
|
return this.httpClient.put(url, sprint, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public deleteSprint(sprint: ScrumSprint): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/sprints/${sprint.id}`;
|
||||||
|
return this.httpClient.delete(url, {observe: 'response'});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Categories
|
||||||
|
public getCategories(): Observable<HttpResponse<ScrumCategory[]>> {
|
||||||
|
const url = `${environment.apiUrl}/categories`;
|
||||||
|
return this.httpClient.get<ScrumCategory[]>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public getCategory(id: number): Observable<HttpResponse<ScrumCategory>> {
|
||||||
|
const url = `${environment.apiUrl}/categories/${id}`;
|
||||||
|
return this.httpClient.get<ScrumCategory>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public postCategory(category: ScrumCategory): Observable<HttpResponse<ScrumCategory>> {
|
||||||
|
const url = `${environment.apiUrl}/categories`;
|
||||||
|
return this.httpClient.post<ScrumCategory>(url, category, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public putCategory(category: ScrumCategory): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/categories/${category.id}`;
|
||||||
|
return this.httpClient.put(url, category, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public deleteCategory(category: ScrumCategory): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/categories/${category.id}`;
|
||||||
|
return this.httpClient.delete(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Status
|
||||||
|
public getAllStatus(): Observable<HttpResponse<ScrumStatus[]>> {
|
||||||
|
const url = `${environment.apiUrl}/status`;
|
||||||
|
return this.httpClient.get<ScrumStatus[]>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public getStatus(id: number): Observable<HttpResponse<ScrumStatus>> {
|
||||||
|
const url = `${environment.apiUrl}/status/${id}`;
|
||||||
|
return this.httpClient.get<ScrumStatus>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public postStatus(status: ScrumStatus): Observable<HttpResponse<ScrumStatus>> {
|
||||||
|
const url = `${environment.apiUrl}/status`;
|
||||||
|
return this.httpClient.post<ScrumStatus>(url, status, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public putStatus(status: ScrumStatus): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/status/${status.id}`;
|
||||||
|
return this.httpClient.put(url, status, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public deleteStatus(status: ScrumStatus): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/status/${status.id}`;
|
||||||
|
return this.httpClient.delete(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Users
|
||||||
|
public getUsers(): Observable<HttpResponse<ScrumUser[]>> {
|
||||||
|
const url = `${environment.apiUrl}/users`;
|
||||||
|
return this.httpClient.get<ScrumUser[]>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public getUser(id: number): Observable<HttpResponse<ScrumUser>> {
|
||||||
|
const url = `${environment.apiUrl}/users/${id}`;
|
||||||
|
return this.httpClient.get<ScrumUser>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public postUser(user: ScrumUser): Observable<HttpResponse<ScrumUser>> {
|
||||||
|
const url = `${environment.apiUrl}/users`;
|
||||||
|
return this.httpClient.post<ScrumUser>(url, user, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public putUser(user: ScrumUser): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/users/${user.id}`;
|
||||||
|
return this.httpClient.put(url, user, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public deleteUser(user: ScrumUser): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/users/${user.id}`;
|
||||||
|
return this.httpClient.delete(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Projects
|
||||||
|
public getProjects(): Observable<HttpResponse<ScrumProject[]>> {
|
||||||
|
const url = `${environment.apiUrl}/projects`;
|
||||||
|
return this.httpClient.get<ScrumProject[]>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public getProject(id: number): Observable<HttpResponse<ScrumProject>> {
|
||||||
|
const url = `${environment.apiUrl}/projects/${id}`;
|
||||||
|
return this.httpClient.get<ScrumProject>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public postProject(project: ScrumProject): Observable<HttpResponse<ScrumProject>> {
|
||||||
|
const url = `${environment.apiUrl}/projects`;
|
||||||
|
return this.httpClient.post<ScrumProject>(url, project, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public putProject(project: ScrumProject): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/projects/${project.id}`;
|
||||||
|
return this.httpClient.put(url, project, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public deleteProject(project: ScrumProject): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/projects/${project.id}`;
|
||||||
|
return this.httpClient.delete(url, { observe: 'response' });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum Priority {
|
export enum Priority {
|
||||||
@ -128,5 +263,3 @@ export interface ScrumProject {
|
|||||||
title: string;
|
title: string;
|
||||||
isprivate: boolean;
|
isprivate: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user