From b7e3c5073a8be71bdbe09da0b63bf62080620ae5 Mon Sep 17 00:00:00 2001 From: Mark Goho Date: Tue, 10 Oct 2017 20:17:21 -0400 Subject: [PATCH 1/3] Remove strongly typed parameters for update and set Strongly typing the parameter requires that the object that's passed in is a complete match for the model. Normally though, you should be able to pass whatever you want to set and update (any number of fields in the model) and it should work. --- src/firestore/document/document.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/firestore/document/document.ts b/src/firestore/document/document.ts index b39b99f3c..6fc166d60 100644 --- a/src/firestore/document/document.ts +++ b/src/firestore/document/document.ts @@ -48,7 +48,7 @@ export class AngularFirestoreDocument { * Create or overwrite a single document. * @param data */ - set(data: T): Promise { + set(data): Promise { return this.ref.set(data); } @@ -56,7 +56,7 @@ export class AngularFirestoreDocument { * Update some fields of a document without overwriting the entire document. * @param data */ - update(data: T): Promise { + update(data): Promise { return this.ref.update(data); } From c22638f0efdbbcf0ae0df986c3a02892debdde33 Mon Sep 17 00:00:00 2001 From: Mark Goho Date: Wed, 11 Oct 2017 12:54:02 -0400 Subject: [PATCH 2/3] Update document.ts --- src/firestore/document/document.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/firestore/document/document.ts b/src/firestore/document/document.ts index 6fc166d60..3452f84ff 100644 --- a/src/firestore/document/document.ts +++ b/src/firestore/document/document.ts @@ -48,7 +48,7 @@ export class AngularFirestoreDocument { * Create or overwrite a single document. * @param data */ - set(data): Promise { + set(data: Partial): Promise { return this.ref.set(data); } @@ -56,7 +56,7 @@ export class AngularFirestoreDocument { * Update some fields of a document without overwriting the entire document. * @param data */ - update(data): Promise { + update(data: Partial): Promise { return this.ref.update(data); } From d3699e0bd514572fb945f123ae6016bc1d3659a6 Mon Sep 17 00:00:00 2001 From: Mark Goho Date: Thu, 12 Oct 2017 16:44:20 -0400 Subject: [PATCH 3/3] leave .set as is, changing .update to partial --- src/firestore/document/document.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/firestore/document/document.ts b/src/firestore/document/document.ts index 3452f84ff..d1ce5d3db 100644 --- a/src/firestore/document/document.ts +++ b/src/firestore/document/document.ts @@ -48,7 +48,7 @@ export class AngularFirestoreDocument { * Create or overwrite a single document. * @param data */ - set(data: Partial): Promise { + set(data: T): Promise { return this.ref.set(data); }