[**@bondsports/general**](../README.md) • **Docs**

***

[@bondsports/general](../globals.md) / validateFieldsToUpdate

# Function: validateFieldsToUpdate()

> **validateFieldsToUpdate**\<`T`\>(`classType`, `entity`, `fieldsToUpdate`): `boolean`

Validates the fields to update in an entity object.

## Type Parameters

• **T** = `any`

The type of the entity object.

## Parameters

• **classType**

The constructor function of the entity object.

• **entity**: `T`

The original entity object.

• **fieldsToUpdate**: `Partial`\<`T`\>

The fields to update in the entity object.

## Returns

`boolean`

- Returns true if there are fields to update, false otherwise.

## Hazard

Dtos should not be used as classType ⚠️. you can use an entity, it will not fail on missing fields in `entity`.

## Defined in

[utils/general.util.ts:125](https://github.com/Bond-Sports/bondUtils/blob/545f16ceb055481acfd7641d7809c0f252d3a5e6/packages/general/src/utils/general.util.ts#L125)
