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

fix(api): centralize upsert validation + improve nested error handling #7173

Open
wants to merge 8 commits into
base: next
Choose a base branch
from

Conversation

tatarco
Copy link
Contributor

@tatarco tatarco commented Nov 30, 2024

feat(api): add upsert validation

What changed? Why was the change needed?

  1. Established a single validation entry point for Upsert use case.
  2. Fixed issue with nested validation based on @djabarovgeorge solution in an old open PR.
  3. Removed the Base Command duplication so all commands use the same validation mechanism.
  4. Fix Wrong Validations around issues in internal commands ( update + create)
  5. Enhance the Filter to produce better and more detailed 400 errors around validation issues.
  6. Make sure post process process update issues if no issues exist instead of empty object, the class validator does not handle empty object well for Record<string,?>
  7. Added tests to validate correct behavior around tags and missing step name, make sure both fire good validation 400 erors

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

feat(api): add upsert validation
Copy link

linear bot commented Nov 30, 2024

Copy link

netlify bot commented Nov 30, 2024

Deploy Preview for dashboard-v2-novu-staging ready!

Name Link
🔨 Latest commit 5bb5222
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/674dad98f25cbc0008b451e5
😎 Deploy Preview https://deploy-preview-7173--dashboard-v2-novu-staging.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 Nov 30, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 5bb5222
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/674dad98da4f340008d9a043
😎 Deploy Preview https://deploy-preview-7173.dashboard-v2.novu-staging.co
📱 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 Nov 30, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 5bb5222
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/674dad98fdcc000008c85548
😎 Deploy Preview https://deploy-preview-7173.dashboard.novu-staging.co
📱 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

pkg-pr-new bot commented Nov 30, 2024

Open in Stackblitz

@novu/client

npm i https://pkg.pr.new/novuhq/novu/@novu/client@7173

@novu/framework

npm i https://pkg.pr.new/novuhq/novu/@novu/framework@7173

@novu/headless

npm i https://pkg.pr.new/novuhq/novu/@novu/headless@7173

@novu/js

npm i https://pkg.pr.new/novuhq/novu/@novu/js@7173

@novu/nextjs

npm i https://pkg.pr.new/novuhq/novu/@novu/nextjs@7173

@novu/node

npm i https://pkg.pr.new/novuhq/novu/@novu/node@7173

@novu/notification-center

npm i https://pkg.pr.new/novuhq/novu/@novu/notification-center@7173

novu

npm i https://pkg.pr.new/novuhq/novu@7173

@novu/providers

npm i https://pkg.pr.new/novuhq/novu/@novu/providers@7173

@novu/react

npm i https://pkg.pr.new/novuhq/novu/@novu/react@7173

@novu/react-native

npm i https://pkg.pr.new/novuhq/novu/@novu/react-native@7173

@novu/shared

npm i https://pkg.pr.new/novuhq/novu/@novu/shared@7173

commit: 5bb5222

@@ -72,7 +72,7 @@ export function toWorkflowsMinifiedDtos(templates: NotificationTemplateEntity[])
}

function toStepResponseDto(persistedStep: NotificationStepEntity): StepResponseDto {
const stepName = persistedStep.name || 'Missing Name';
const stepName = persistedStep.name || 'Missing Name || UPDATE IMMEDIATELY';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs to be here, either that or an exception in case of missing name, the entity allows missing names, but our API no more @SokratisVidros

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.

1 participant