Skip to content

Commit

Permalink
Use appropriate IsValidRedirectUrlValidator (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelblum authored Jul 18, 2024
1 parent 948d447 commit 85af17c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { IsUndefinable } from "@comet/cms-api";
import { Type } from "@nestjs/common";
import { Field, InputType } from "@nestjs/graphql";
import { Type as TypeTransformer } from "class-transformer";
import { IsBoolean, IsNotEmpty, IsOptional, IsString, IsUrl, Validate, ValidateNested } from "class-validator";
import { IsBoolean, IsNotEmpty, IsOptional, IsString, IsUrl, ValidateNested } from "class-validator";

import { BrevoContactAttributesInterface } from "../../types";
import { IsValidRedirectURLConstraint } from "../validator/redirect-url.validator";
import { IsValidRedirectURL } from "../validator/redirect-url.validator";

export interface BrevoContactInputInterface {
email: string;
Expand Down Expand Up @@ -41,7 +41,7 @@ export class BrevoContactInputFactory {

@Field()
@IsUrl({ require_tld: process.env.NODE_ENV === "production" })
@Validate(IsValidRedirectURLConstraint)
@IsValidRedirectURL()
redirectionUrl: string;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/brevo-contact/dto/subscribe-input.factory.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Type } from "@nestjs/common";
import { Field, InputType } from "@nestjs/graphql";
import { IsEmail, IsUrl, Validate } from "class-validator";
import { IsEmail, IsUrl } from "class-validator";

import { BrevoContactAttributesInterface, EmailCampaignScopeInterface } from "../../types";
import { IsValidRedirectURLConstraint } from "../validator/redirect-url.validator";
import { IsValidRedirectURL } from "../validator/redirect-url.validator";

export interface SubscribeInputInterface {
email: string;
Expand All @@ -27,7 +27,7 @@ export class SubscribeInputFactory {

@Field()
@IsUrl({ require_tld: process.env.NODE_ENV === "production" })
@Validate(IsValidRedirectURLConstraint)
@IsValidRedirectURL()
redirectionUrl: string;
}

Expand Down

0 comments on commit 85af17c

Please sign in to comment.