@edgedev/firebase 1.7.5 → 1.7.6
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/edgeFirebase.ts +22 -0
- package/package.json +1 -1
package/edgeFirebase.ts
CHANGED
|
@@ -1535,6 +1535,28 @@ export const EdgeFirebase = class {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
};
|
|
1537
1537
|
|
|
1538
|
+
//TODO: Add documentation for this function
|
|
1539
|
+
public storeDocRaw = async (
|
|
1540
|
+
collectionPath: string,
|
|
1541
|
+
item: object,
|
|
1542
|
+
docId?: string,
|
|
1543
|
+
): Promise<actionResponse> => {
|
|
1544
|
+
const cloneItem = JSON.parse(JSON.stringify(item));
|
|
1545
|
+
if (docId !== undefined) {
|
|
1546
|
+
await setDoc( doc(this.db, collectionPath, docId), cloneItem);
|
|
1547
|
+
} else {
|
|
1548
|
+
await addDoc(
|
|
1549
|
+
collection(this.db, collectionPath),
|
|
1550
|
+
cloneItem
|
|
1551
|
+
);
|
|
1552
|
+
}
|
|
1553
|
+
return this.sendResponse({
|
|
1554
|
+
success: true,
|
|
1555
|
+
message: "",
|
|
1556
|
+
meta: {}
|
|
1557
|
+
});
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1538
1560
|
|
|
1539
1561
|
public storeDoc = async (
|
|
1540
1562
|
collectionPath: string,
|