svelte-firekit 0.0.11 → 0.0.12

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.
@@ -7,7 +7,7 @@ declare class FirekitDocumentMutations {
7
7
  set<T extends DocumentData>(path: string, data: WithFieldValue<T>, options?: {
8
8
  merge?: boolean;
9
9
  timestamps?: boolean;
10
- }): Promise<void>;
10
+ }): Promise<string>;
11
11
  update<T extends DocumentData>(path: string, data: PartialWithFieldValue<T>, options?: {
12
12
  timestamps?: boolean;
13
13
  }): Promise<void>;
@@ -22,7 +22,7 @@ class FirekitDocumentMutations {
22
22
  timestamps: true,
23
23
  }) {
24
24
  const firestore = firebaseService.getDb();
25
- const docRef = doc(firestore, path);
25
+ const docRef = doc(collection(firestore, path));
26
26
  const dataToSet = {
27
27
  ...data,
28
28
  ...(options.timestamps && {
@@ -31,8 +31,10 @@ class FirekitDocumentMutations {
31
31
  updatedAt: serverTimestamp(),
32
32
  updatedBy: firekitAuthManager.uid,
33
33
  }),
34
+ uid: docRef.id,
34
35
  };
35
- return setDoc(docRef, dataToSet, { merge: options.merge });
36
+ await setDoc(docRef, dataToSet, { merge: options.merge });
37
+ return docRef.id;
36
38
  }
37
39
  async update(path, data, options = { timestamps: true }) {
38
40
  const firestore = firebaseService.getDb();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-firekit",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev",