mirror of
https://github.com/hexastack/hexabot
synced 2025-05-05 05:15:02 +00:00
Merge pull request #521 from Hexastack/fix/utils-strict-null-check
fix: utilities decorators IsLessThanDate, IsObjectId
This commit is contained in:
commit
c3518d003a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@ -8,15 +8,15 @@
|
||||
|
||||
import {
|
||||
registerDecorator,
|
||||
ValidationOptions,
|
||||
ValidationArguments,
|
||||
ValidationOptions,
|
||||
} from 'class-validator';
|
||||
|
||||
export function IsLessThanDate(
|
||||
property: string,
|
||||
validationOptions?: ValidationOptions,
|
||||
) {
|
||||
return (object: unknown, propertyName: string) => {
|
||||
return (object: object, propertyName: string) => {
|
||||
registerDecorator({
|
||||
target: object.constructor,
|
||||
propertyName,
|
||||
|
@ -11,7 +11,7 @@ import { Types } from 'mongoose';
|
||||
|
||||
export const IsObjectId =
|
||||
(validationOptions?: ValidationOptions) =>
|
||||
(object: unknown, propertyName: string) =>
|
||||
(object: object, propertyName: string) =>
|
||||
registerDecorator({
|
||||
target: object.constructor,
|
||||
propertyName,
|
||||
|
Loading…
Reference in New Issue
Block a user