@yomotech/view-toolkit 0.0.8 → 0.0.9
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.
|
@@ -2412,8 +2412,6 @@ class Couchdb {
|
|
|
2412
2412
|
async getFileContentFromCouchDb(couchDbName, filePath) {
|
|
2413
2413
|
try {
|
|
2414
2414
|
const dbName = couchDbName;
|
|
2415
|
-
console.log('dbName: ', dbName);
|
|
2416
|
-
console.log('filePath: ', filePath);
|
|
2417
2415
|
const docId = filePath?.trim();
|
|
2418
2416
|
if (!docId) {
|
|
2419
2417
|
console.error('Missing file path');
|
|
@@ -2504,12 +2502,25 @@ class Couchdb {
|
|
|
2504
2502
|
}
|
|
2505
2503
|
async buildTenantHeaders() {
|
|
2506
2504
|
const tenantKey = await this.utilityService.getStorage('tenantKey');
|
|
2507
|
-
|
|
2508
|
-
|
|
2505
|
+
const tenantName = await this.utilityService.getStorage('tenantName');
|
|
2506
|
+
if (tenantKey) {
|
|
2507
|
+
console.log('tenantKey: ', tenantKey);
|
|
2508
|
+
if (typeof tenantKey !== 'string' || !tenantKey.trim()) {
|
|
2509
|
+
throw new Error('Missing tenantKey');
|
|
2510
|
+
}
|
|
2511
|
+
return {
|
|
2512
|
+
'X-Tenant-Key': tenantKey.trim(),
|
|
2513
|
+
};
|
|
2514
|
+
}
|
|
2515
|
+
else {
|
|
2516
|
+
console.log('tenantName: ', tenantName);
|
|
2517
|
+
if (typeof tenantName !== 'string' || !tenantName.trim()) {
|
|
2518
|
+
throw new Error('Missing tenantName');
|
|
2519
|
+
}
|
|
2520
|
+
return {
|
|
2521
|
+
'X-Tenant': tenantName.trim(),
|
|
2522
|
+
};
|
|
2509
2523
|
}
|
|
2510
|
-
return {
|
|
2511
|
-
'X-Tenant-Key': tenantKey.trim(),
|
|
2512
|
-
};
|
|
2513
2524
|
}
|
|
2514
2525
|
async getImageSrcFromCouchDb(couchDbName, filePath) {
|
|
2515
2526
|
const dbName = couchDbName;
|