Home > @infiniteobjects/models > Repository > updateInstance
Updates an entity with new data
Signature:
updateInstance(data: PartialDeep<Model<EntityType>> | EntityType, instance: EntityType, admin?: boolean): EntityType;
Parameter | Type | Description |
---|---|---|
data | PartialDeep<Model<EntityType>> | EntityType | The data to update |
instance | EntityType | The instance to be updated |
admin | boolean | (Optional) Pass true if to use Admin fields (only used if the data is not an entity already) |
Returns:
EntityType