@nina-protocol/nina-db 0.0.27 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,8 @@ class Post extends Model {
27
27
  this.publisher = publisher.publicKey;
28
28
  if (publishedThroughHub) {
29
29
  this.publishedThroughHub = publishedThroughHub.publicKey;
30
+ this.hub = publishedThroughHub;
31
+ delete this.hub.id;
30
32
  }
31
33
  delete this.publisherId;
32
34
  delete this.id;
@@ -103,6 +103,9 @@ class Release extends Model {
103
103
  this.publishedThroughHub = publishedThroughHub.publicKey;
104
104
  this.hub = publishedThroughHub;
105
105
  delete this.hub.id;
106
+ const authority = await this.hub.$relatedQuery('authority').select('publicKey');
107
+ this.hub.authority = authority.publicKey;
108
+ delete this.hub.authorityId;
106
109
  }
107
110
  this.publisher = publisher.publicKey;
108
111
  delete this.publisherId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nina-protocol/nina-db",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -30,6 +30,8 @@ class Post extends Model {
30
30
  this.publisher = publisher.publicKey;
31
31
  if (publishedThroughHub) {
32
32
  this.publishedThroughHub = publishedThroughHub.publicKey;
33
+ this.hub = publishedThroughHub;
34
+ delete this.hub.id;
33
35
  }
34
36
 
35
37
  delete this.publisherId
@@ -112,6 +112,9 @@ export default class Release extends Model {
112
112
  this.publishedThroughHub = publishedThroughHub.publicKey;
113
113
  this.hub = publishedThroughHub;
114
114
  delete this.hub.id;
115
+ const authority = await this.hub.$relatedQuery('authority').select('publicKey');
116
+ this.hub.authority = authority.publicKey;
117
+ delete this.hub.authorityId;
115
118
  }
116
119
  this.publisher = publisher.publicKey;
117
120
  delete this.publisherId