@yomotech/view-toolkit 0.0.35 → 0.0.37

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.
@@ -173,6 +173,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
173
173
  class RequestService {
174
174
  http;
175
175
  pageSize = 0;
176
+ backendUrl = '/api';
177
+ apiUrl = `${this.backendUrl}/project`;
176
178
  constructor(http) {
177
179
  this.http = http;
178
180
  }
@@ -198,6 +200,12 @@ class RequestService {
198
200
  }
199
201
  ;
200
202
  }
203
+ readFile(projectName, path) {
204
+ return this.http.post(`${this.apiUrl}/read`, {
205
+ projectName: projectName,
206
+ filePath: path
207
+ });
208
+ }
201
209
  getMainLayout(selectedProject) {
202
210
  return this.http.get(`../assets/projects/${selectedProject}/main/layout_schema.json`);
203
211
  }
@@ -2554,7 +2562,7 @@ class Couchdb {
2554
2562
  }
2555
2563
  async getFileContentFromCouchDb(couchDbName, filePath) {
2556
2564
  try {
2557
- const dbName = couchDbName;
2565
+ const dbName = couchDbName?.toLowerCase();
2558
2566
  const docId = filePath?.trim();
2559
2567
  if (!docId) {
2560
2568
  console.error('Missing file path');
@@ -2713,7 +2721,7 @@ class Couchdb {
2713
2721
  }
2714
2722
  }
2715
2723
  async getImageSrcFromCouchDb(couchDbName, filePath) {
2716
- const dbName = couchDbName;
2724
+ const dbName = couchDbName?.toLowerCase();
2717
2725
  const docId = filePath?.trim();
2718
2726
  if (!docId) {
2719
2727
  throw new Error('Missing file path');