@social-mail/social-mail-web-server 1.9.28 → 1.9.30

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.9.28",
3
+ "version": "1.9.30",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -134,10 +134,14 @@ export default class SnapshotService
134
134
  && x.name === "template.html")
135
135
  .first();
136
136
  if (templateFile) {
137
+ console.log(`Rewriting template.html`);
137
138
  const templateFileContent = await this.wcs.getSnapshotFile(ws, ["template.html"]);
138
139
  // we need to save the file content..
139
140
  await this.storage.updateFile(templateFile, templateFileContent);
140
- await db.appFiles.statements.update({ fileContentID: templateFile.fileContentID}, { appFileID: templateFile.appFileID });
141
+ await db.appFiles.statements.update({
142
+ fileContentID: templateFile.fileContentID,
143
+ dateUpdated: dateCreated
144
+ }, { appFileID: templateFile.appFileID });
141
145
  }
142
146
  }
143
147
 
@@ -122,15 +122,13 @@ export default class WebSiteContentService
122
122
  }
123
123
 
124
124
  async getCurrentSnapshot(folderID) {
125
-
126
- const site = await this.db.websiteFolders.where({ folderID }, (p) => (x) =>
127
- x.folderID === p.folderID)
128
- .first();
129
- if (!site) {
125
+ const siteHost = await this.db.websiteFolderHosts.where({ folderID }, (p) => (x) => x.folderID === p.folderID )
126
+ .include((x) => x.folder)
127
+ .first();
128
+ if (!siteHost) {
130
129
  return null;
131
130
  }
132
- const { host } = await this.db.websiteFolderHosts.where({ folderID }, (p) => (x) => x.folderID === p.folderID )
133
- .first();
131
+ const { folder: site, host } = siteHost;
134
132
  return {
135
133
  snapshotFolderID: site.currentVersionID,
136
134
  folderID: site.folderID,