Skip to content

Commit c8094aa

Browse files
committed
fix: restore broken updateOnline type
1 parent fd5baab commit c8094aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/firestore/firestore-lite.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
deleteDoc,
1515
updateDoc,
1616
serverTimestamp,
17+
type PartialWithFieldValue,
1718
} from 'firebase/firestore/lite';
1819

1920
import { getUid } from '../auth/uid';
@@ -88,15 +89,15 @@ async function getDocument<T>(ref: DocPredicate<T>): Promise<T> {
8889
* Be sure to import firestore methods such as serverTimestamp() from firebase/firestore/lite otherwise you will receive errors */
8990
export async function updateOnline<T>(
9091
ref: DocPredicate<T>,
91-
data: DocumentData,
92+
data: PartialWithFieldValue<T>,
9293
opts: {
9394
abbreviate?: boolean;
9495
} = {}
9596
): Promise<void> {
9697
data[opts.abbreviate ? 'ua' : 'updatedAt'] = serverTimestamp();
9798
data[opts.abbreviate ? 'ub' : 'updatedBy'] = getUid();
9899
// return updateDoc(docRef(ref), data as UpdateData<T>);
99-
return updateDoc(docRef(ref), data);
100+
return updateDoc(docRef(ref), data as DocumentData);
100101
}
101102

102103
/**

0 commit comments

Comments
 (0)