Merge pull request #520 from Hexastack/fix/base-controller-ts-strict-null-check

fix: base-controller
This commit is contained in:
Med Marrouchi 2025-01-06 17:27:18 +01:00 committed by GitHub
commit b4b1edfa09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,7 +44,7 @@ export abstract class BaseController<
* @throws {NotFoundException} Throws a NotFoundException if any invalid IDs are found. * @throws {NotFoundException} Throws a NotFoundException if any invalid IDs are found.
*/ */
protected validate({ dto, allowedIds }: TValidateProps<T, TStub>): void { protected validate({ dto, allowedIds }: TValidateProps<T, TStub>): void {
const exceptions = []; const exceptions: string[] = [];
Object.entries(dto) Object.entries(dto)
.filter(([key]) => Object.keys(allowedIds).includes(key)) .filter(([key]) => Object.keys(allowedIds).includes(key))
.forEach(([field]) => { .forEach(([field]) => {