Skip to content

Commit

Permalink
fix: update setField to correct typing (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
wschurman authored Jul 11, 2020
1 parent 9c92d10 commit 7a77afc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/entity/src/EntityMutator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class CreateMutator<
* @param fieldName - entity field being updated
* @param value - value for entity field
*/
setField<K extends keyof TFields>(fieldName: K, value: TFields[K]): this {
setField<K extends keyof Pick<TFields, TSelectedFields>>(fieldName: K, value: TFields[K]): this {
this.fieldsForEntity[fieldName] = value;
return this;
}
Expand Down Expand Up @@ -193,7 +193,7 @@ export class UpdateMutator<
* @param fieldName - entity field being updated
* @param value - value for entity field
*/
setField<K extends keyof TFields>(fieldName: K, value: TFields[K]): this {
setField<K extends keyof Pick<TFields, TSelectedFields>>(fieldName: K, value: TFields[K]): this {
this.fieldsForEntity[fieldName] = value;
this.updatedFields[fieldName] = value;
return this;
Expand Down

0 comments on commit 7a77afc

Please sign in to comment.