|
@@ -22,7 +22,7 @@ export class ContentItem {
|
|
|
public readonly fromContactId?: string;
|
|
public readonly fromContactId?: string;
|
|
|
public readonly toContactId?: string;
|
|
public readonly toContactId?: string;
|
|
|
public readonly media?: string;
|
|
public readonly media?: string;
|
|
|
- public readonly relTargets: any;
|
|
|
|
|
|
|
+ public readonly relTarget: any;
|
|
|
|
|
|
|
|
constructor(hash: string, props: ContentParams) {
|
|
constructor(hash: string, props: ContentParams) {
|
|
|
this.data = props;
|
|
this.data = props;
|
|
@@ -49,7 +49,7 @@ export class ContentItem {
|
|
|
this.fromContactId = this.allLinks.filter(x => x.rel === '.from-contact-id').map(x => x.target)[0];
|
|
this.fromContactId = this.allLinks.filter(x => x.rel === '.from-contact-id').map(x => x.target)[0];
|
|
|
this.toContactId = this.allLinks.filter(x => x.rel === '.to-contact-id').map(x => x.target)[0];
|
|
this.toContactId = this.allLinks.filter(x => x.rel === '.to-contact-id').map(x => x.target)[0];
|
|
|
this.media = this.allLinks.filter(x => x.rel === '.media').map(x => x.target)[0];
|
|
this.media = this.allLinks.filter(x => x.rel === '.media').map(x => x.target)[0];
|
|
|
- this.relTargets = this.allLinks.reduce((accum, link) => {
|
|
|
|
|
|
|
+ this.relTarget = this.allLinks.reduce((accum, link) => {
|
|
|
accum[link.rel] = link.target;
|
|
accum[link.rel] = link.target;
|
|
|
return accum;
|
|
return accum;
|
|
|
}, {});
|
|
}, {});
|