@blackcode_sa/metaestetics-api 1.6.22 → 1.6.23
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/dist/backoffice/index.js
CHANGED
|
@@ -1628,8 +1628,9 @@ var DocumentationTemplateService = class extends BaseService {
|
|
|
1628
1628
|
* @returns The updated template
|
|
1629
1629
|
*/
|
|
1630
1630
|
async updateTemplate(templateId, data) {
|
|
1631
|
-
var _a, _b, _c
|
|
1631
|
+
var _a, _b, _c;
|
|
1632
1632
|
const validatedData = updateDocumentTemplateSchema.parse(data);
|
|
1633
|
+
console.log("Validated data", validatedData);
|
|
1633
1634
|
const template = await this.getTemplateById(templateId);
|
|
1634
1635
|
if (!template) {
|
|
1635
1636
|
throw new Error(`Template with ID ${templateId} not found`);
|
|
@@ -1654,10 +1655,11 @@ var DocumentationTemplateService = class extends BaseService {
|
|
|
1654
1655
|
updatePayload.isActive = validatedData.isActive;
|
|
1655
1656
|
if (validatedData.tags !== void 0)
|
|
1656
1657
|
updatePayload.tags = validatedData.tags;
|
|
1657
|
-
updatePayload.isUserForm = (
|
|
1658
|
-
updatePayload.isRequired = (
|
|
1659
|
-
updatePayload.sortingOrder = (
|
|
1658
|
+
updatePayload.isUserForm = (_a = validatedData.isUserForm) != null ? _a : false;
|
|
1659
|
+
updatePayload.isRequired = (_b = validatedData.isRequired) != null ? _b : false;
|
|
1660
|
+
updatePayload.sortingOrder = (_c = validatedData.sortingOrder) != null ? _c : 0;
|
|
1660
1661
|
const docRef = (0, import_firestore7.doc)(this.collectionRef, templateId);
|
|
1662
|
+
console.log("Update payload", updatePayload);
|
|
1661
1663
|
await (0, import_firestore7.updateDoc)(docRef, updatePayload);
|
|
1662
1664
|
return { ...template, ...updatePayload };
|
|
1663
1665
|
}
|
|
@@ -1605,8 +1605,9 @@ var DocumentationTemplateService = class extends BaseService {
|
|
|
1605
1605
|
* @returns The updated template
|
|
1606
1606
|
*/
|
|
1607
1607
|
async updateTemplate(templateId, data) {
|
|
1608
|
-
var _a, _b, _c
|
|
1608
|
+
var _a, _b, _c;
|
|
1609
1609
|
const validatedData = updateDocumentTemplateSchema.parse(data);
|
|
1610
|
+
console.log("Validated data", validatedData);
|
|
1610
1611
|
const template = await this.getTemplateById(templateId);
|
|
1611
1612
|
if (!template) {
|
|
1612
1613
|
throw new Error(`Template with ID ${templateId} not found`);
|
|
@@ -1631,10 +1632,11 @@ var DocumentationTemplateService = class extends BaseService {
|
|
|
1631
1632
|
updatePayload.isActive = validatedData.isActive;
|
|
1632
1633
|
if (validatedData.tags !== void 0)
|
|
1633
1634
|
updatePayload.tags = validatedData.tags;
|
|
1634
|
-
updatePayload.isUserForm = (
|
|
1635
|
-
updatePayload.isRequired = (
|
|
1636
|
-
updatePayload.sortingOrder = (
|
|
1635
|
+
updatePayload.isUserForm = (_a = validatedData.isUserForm) != null ? _a : false;
|
|
1636
|
+
updatePayload.isRequired = (_b = validatedData.isRequired) != null ? _b : false;
|
|
1637
|
+
updatePayload.sortingOrder = (_c = validatedData.sortingOrder) != null ? _c : 0;
|
|
1637
1638
|
const docRef = doc7(this.collectionRef, templateId);
|
|
1639
|
+
console.log("Update payload", updatePayload);
|
|
1638
1640
|
await updateDoc7(docRef, updatePayload);
|
|
1639
1641
|
return { ...template, ...updatePayload };
|
|
1640
1642
|
}
|
package/dist/index.js
CHANGED
|
@@ -8443,8 +8443,9 @@ var DocumentationTemplateService = class extends BaseService {
|
|
|
8443
8443
|
* @returns The updated template
|
|
8444
8444
|
*/
|
|
8445
8445
|
async updateTemplate(templateId, data) {
|
|
8446
|
-
var _a, _b, _c
|
|
8446
|
+
var _a, _b, _c;
|
|
8447
8447
|
const validatedData = updateDocumentTemplateSchema.parse(data);
|
|
8448
|
+
console.log("Validated data", validatedData);
|
|
8448
8449
|
const template = await this.getTemplateById(templateId);
|
|
8449
8450
|
if (!template) {
|
|
8450
8451
|
throw new Error(`Template with ID ${templateId} not found`);
|
|
@@ -8469,10 +8470,11 @@ var DocumentationTemplateService = class extends BaseService {
|
|
|
8469
8470
|
updatePayload.isActive = validatedData.isActive;
|
|
8470
8471
|
if (validatedData.tags !== void 0)
|
|
8471
8472
|
updatePayload.tags = validatedData.tags;
|
|
8472
|
-
updatePayload.isUserForm = (
|
|
8473
|
-
updatePayload.isRequired = (
|
|
8474
|
-
updatePayload.sortingOrder = (
|
|
8473
|
+
updatePayload.isUserForm = (_a = validatedData.isUserForm) != null ? _a : false;
|
|
8474
|
+
updatePayload.isRequired = (_b = validatedData.isRequired) != null ? _b : false;
|
|
8475
|
+
updatePayload.sortingOrder = (_c = validatedData.sortingOrder) != null ? _c : 0;
|
|
8475
8476
|
const docRef = (0, import_firestore25.doc)(this.collectionRef, templateId);
|
|
8477
|
+
console.log("Update payload", updatePayload);
|
|
8476
8478
|
await (0, import_firestore25.updateDoc)(docRef, updatePayload);
|
|
8477
8479
|
return { ...template, ...updatePayload };
|
|
8478
8480
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -8431,8 +8431,9 @@ var DocumentationTemplateService = class extends BaseService {
|
|
|
8431
8431
|
* @returns The updated template
|
|
8432
8432
|
*/
|
|
8433
8433
|
async updateTemplate(templateId, data) {
|
|
8434
|
-
var _a, _b, _c
|
|
8434
|
+
var _a, _b, _c;
|
|
8435
8435
|
const validatedData = updateDocumentTemplateSchema.parse(data);
|
|
8436
|
+
console.log("Validated data", validatedData);
|
|
8436
8437
|
const template = await this.getTemplateById(templateId);
|
|
8437
8438
|
if (!template) {
|
|
8438
8439
|
throw new Error(`Template with ID ${templateId} not found`);
|
|
@@ -8457,10 +8458,11 @@ var DocumentationTemplateService = class extends BaseService {
|
|
|
8457
8458
|
updatePayload.isActive = validatedData.isActive;
|
|
8458
8459
|
if (validatedData.tags !== void 0)
|
|
8459
8460
|
updatePayload.tags = validatedData.tags;
|
|
8460
|
-
updatePayload.isUserForm = (
|
|
8461
|
-
updatePayload.isRequired = (
|
|
8462
|
-
updatePayload.sortingOrder = (
|
|
8461
|
+
updatePayload.isUserForm = (_a = validatedData.isUserForm) != null ? _a : false;
|
|
8462
|
+
updatePayload.isRequired = (_b = validatedData.isRequired) != null ? _b : false;
|
|
8463
|
+
updatePayload.sortingOrder = (_c = validatedData.sortingOrder) != null ? _c : 0;
|
|
8463
8464
|
const docRef = doc16(this.collectionRef, templateId);
|
|
8465
|
+
console.log("Update payload", updatePayload);
|
|
8464
8466
|
await updateDoc16(docRef, updatePayload);
|
|
8465
8467
|
return { ...template, ...updatePayload };
|
|
8466
8468
|
}
|
package/package.json
CHANGED
|
@@ -113,6 +113,7 @@ export class DocumentationTemplateService extends BaseService {
|
|
|
113
113
|
): Promise<DocumentTemplate> {
|
|
114
114
|
// Validate data
|
|
115
115
|
const validatedData = updateDocumentTemplateSchema.parse(data);
|
|
116
|
+
console.log("Validated data", validatedData);
|
|
116
117
|
|
|
117
118
|
// Get existing template
|
|
118
119
|
const template = await this.getTemplateById(templateId);
|
|
@@ -146,14 +147,12 @@ export class DocumentationTemplateService extends BaseService {
|
|
|
146
147
|
updatePayload.tags = validatedData.tags;
|
|
147
148
|
|
|
148
149
|
// Always include these properties with defaults if they're missing
|
|
149
|
-
updatePayload.isUserForm =
|
|
150
|
-
|
|
151
|
-
updatePayload.
|
|
152
|
-
validatedData.isRequired ?? template.isRequired ?? false;
|
|
153
|
-
updatePayload.sortingOrder =
|
|
154
|
-
validatedData.sortingOrder ?? template.sortingOrder ?? 0;
|
|
150
|
+
updatePayload.isUserForm = validatedData.isUserForm ?? false;
|
|
151
|
+
updatePayload.isRequired = validatedData.isRequired ?? false;
|
|
152
|
+
updatePayload.sortingOrder = validatedData.sortingOrder ?? 0;
|
|
155
153
|
|
|
156
154
|
const docRef = doc(this.collectionRef, templateId);
|
|
155
|
+
console.log("Update payload", updatePayload);
|
|
157
156
|
await updateDoc(docRef, updatePayload);
|
|
158
157
|
|
|
159
158
|
return { ...template, ...updatePayload } as DocumentTemplate;
|