Skip to content
Snippets Groups Projects
Commit 15d1d5e9 authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Add updateContent & deleteContent functio to content service

parent 053e5196
No related merge requests found
......@@ -41,10 +41,19 @@ export class ContentService extends BaseHttpService {
);
}
getContent(contentId: string): Observable<Content> {
const connectionUrl = `${this.apiUrl.base}/?contentId=${contentId}`;
return this.http.get<Content>(connectionUrl).pipe(
catchError(this.handleError<Content>(`getContent id=${contentId}`))
updateContent(updatedContent: Content): Observable<Content> {
const connectionUrl = this.apiUrl.base + this.apiUrl.content + '/' + updatedContent.contentId;
return this.http.put(connectionUrl, updatedContent, httpOptions).pipe(
tap(_ => ''),
catchError(this.handleError<any>('updateContent'))
);
}
deleteContent(content: Content): Observable<Content> {
const connectionUrl = this.apiUrl.base + this.apiUrl.content + '/' + content.contentId;
return this.http.delete<Content>(connectionUrl, httpOptions).pipe(
tap (_ => ''),
catchError(this.handleError<Content>('deleteContent'))
);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment