File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414 deleteDoc ,
1515 updateDoc ,
1616 serverTimestamp ,
17+ type PartialWithFieldValue ,
1718} from 'firebase/firestore/lite' ;
1819
1920import { 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/**
You can’t perform that action at this time.
0 commit comments