mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5426] Remove compatibility layer from Lib (#7110)
* remove compatibility step 1 * remove compatibility step 2 * remove compatibility step 3 * remove compatibility step 4 * remove compatibility step 5
This commit is contained in:
@@ -21,15 +21,18 @@ import { CommentModel } from '../models/comment.model';
|
||||
import { AlfrescoApiService } from '../services/alfresco-api.service';
|
||||
import { LogService } from '../services/log.service';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { CommentEntry } from '@alfresco/js-api';
|
||||
import { CommentEntry, CommentsApi } from '@alfresco/js-api';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CommentContentService {
|
||||
|
||||
private commentsApi: CommentsApi;
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private logService: LogService) {
|
||||
this.commentsApi = new CommentsApi(this.apiService.getInstance());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,7 +42,7 @@ export class CommentContentService {
|
||||
* @returns Details of the comment added
|
||||
*/
|
||||
addNodeComment(nodeId: string, message: string): Observable<CommentModel> {
|
||||
return from(this.apiService.getInstance().core.commentsApi.addComment(nodeId, {content: message}))
|
||||
return from(this.commentsApi.createComment(nodeId, {content: message}))
|
||||
.pipe(
|
||||
map((response: CommentEntry) => {
|
||||
return new CommentModel({
|
||||
@@ -59,7 +62,7 @@ export class CommentContentService {
|
||||
* @returns Details for each comment
|
||||
*/
|
||||
getNodeComments(nodeId: string): Observable<CommentModel[]> {
|
||||
return from(this.apiService.getInstance().core.commentsApi.getComments(nodeId))
|
||||
return from(this.commentsApi.listComments(nodeId))
|
||||
.pipe(
|
||||
map((response) => {
|
||||
const comments: CommentModel[] = [];
|
||||
|
Reference in New Issue
Block a user