mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3062] dual api support for Favorites (#3447)
* dual api support for Favorites * unit test
This commit is contained in:
committed by
Eugenio Romano
parent
9bb941887a
commit
1838818295
@@ -125,9 +125,17 @@ export class NodeFavoriteDirective implements OnChanges {
|
||||
}
|
||||
|
||||
private getFavorite(selected: MinimalNodeEntity): Observable<any> {
|
||||
const { name, isFile, isFolder } = selected.entry;
|
||||
const node = selected.entry;
|
||||
|
||||
// ACS 6.x with 'isFavorite' include
|
||||
if (node && node.hasOwnProperty('isFavorite')) {
|
||||
return Observable.of(selected);
|
||||
}
|
||||
|
||||
// ACS 5.x and 6.x without 'isFavorite' include
|
||||
const { name, isFile, isFolder } = node;
|
||||
// shared files have nodeId
|
||||
const id = (<any> selected).entry.nodeId || selected.entry.id;
|
||||
const id = node.nodeId || node.id;
|
||||
|
||||
const promise = this.alfrescoApiService.favoritesApi.getFavorite('-me-', id);
|
||||
|
||||
|
Reference in New Issue
Block a user