@social-mail/social-mail-web-server 1.8.425 → 1.8.426

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.8.425",
3
+ "version": "1.8.426",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -11,6 +11,7 @@ import { ISiteFolder } from "./ISiteFolder.js";
11
11
  import EncryptionService from "../encryption/EncryptionService.js";
12
12
  import { hash } from "crypto";
13
13
  import Sql from "@entity-access/entity-access/dist/sql/Sql.js";
14
+ import ReplicaReader from "../replica/ReplicaReader.js";
14
15
 
15
16
  /**
16
17
  * We cannot read from replica as relative path can change anytime, only absolute file content id can be read from replica.
@@ -69,14 +70,16 @@ export default class WebSiteContentService
69
70
 
70
71
  @cacheFor()
71
72
  async getWebSiteFolder(folderID) {
72
- return this.db.websiteFolders.where({ folderID }, (p) => (x) => x.folderID === p.folderID)
73
- .first();
73
+ const replicaReader = ServiceProvider.resolve(this, ReplicaReader);
74
+ return replicaReader.query((db) => db.websiteFolders.where({ folderID }, (p) => (x) => x.folderID === p.folderID)
75
+ .first());
74
76
  }
75
77
 
76
78
  @cacheFor()
77
79
  async getWebSite(host) {
78
- const folder = await this.db.websiteFolders.where({ host }, (p) => (x) => x.hosts.some((s) => s.host === p.host))
79
- .first();
80
+ const replicaReader = ServiceProvider.resolve(this, ReplicaReader);
81
+ const folder = await replicaReader.query((db) => this.db.websiteFolders.where({ host }, (p) => (x) => x.hosts.some((s) => s.host === p.host))
82
+ .first());
80
83
  if (!folder) {
81
84
  return null;
82
85
  }