Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): add enable type validation #5603

Conversation

djabarovgeorge
Copy link
Contributor

@djabarovgeorge djabarovgeorge commented May 20, 2024

What changed? Why was the change needed?

Fix - CastError: Cast to Boolean failed for value "" (type string) at path "channels.sms" because of "CastError"

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added missing validation on our dto.

@@ -31,7 +31,7 @@ describe('Update Subscribers preferences - /subscribers/:subscriberId/preference

try {
const response = await updatePreference(updateDataEmailFalse as any, session, template._id);
expect(response).to.not.be;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we were missing the 'ok' in order test in order to trigger failure if the test is falsely passed.

@@ -9,6 +10,8 @@ export class UpdateSubscriberPreferenceRequestDto {
description: 'The subscriber preferences for every ChannelTypeEnum for the workflow assigned.',
})
@ValidateNested()
@Type(() => ChannelPreference)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed in order to execute @ValidateNested()

Copy link

netlify bot commented May 20, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit a00ee4f
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/664b59de55d44100080f3249
😎 Deploy Preview https://deploy-preview-5603--dev-web-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 20, 2024

Deploy Preview for novu-design ready!

Name Link
🔨 Latest commit a00ee4f
🔍 Latest deploy log https://app.netlify.com/sites/novu-design/deploys/664b59de0eee3b000827fab3
😎 Deploy Preview https://deploy-preview-5603--novu-design.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@ainouzgali ainouzgali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤩

@djabarovgeorge djabarovgeorge merged commit d993982 into next May 20, 2024
17 checks passed
@djabarovgeorge djabarovgeorge deleted the nv-3827-casterror-cast-to-boolean-failed-for-value-type-string-at-path branch May 20, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants