refactor core

This commit is contained in:
Eugenio Romano
2021-08-15 20:07:50 +02:00
parent b8e7e79b26
commit b04308deaa
27 changed files with 160 additions and 93 deletions

View File

@@ -28,11 +28,12 @@ import { CommentEntry, CommentsApi } from '@alfresco/js-api';
})
export class CommentContentService {
private commentsApi: CommentsApi;
get commentsApi(): CommentsApi {
return new CommentsApi(this.apiService.getInstance());
}
constructor(private apiService: AlfrescoApiService,
private logService: LogService) {
this.commentsApi = new CommentsApi(this.apiService.getInstance());
}
/**
@@ -42,7 +43,7 @@ export class CommentContentService {
* @returns Details of the comment added
*/
addNodeComment(nodeId: string, message: string): Observable<CommentModel> {
return from(this.commentsApi.createComment(nodeId, {content: message}))
return from(this.commentsApi.createComment(nodeId, { content: message }))
.pipe(
map((response: CommentEntry) => {
return new CommentModel({