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-service): workflow creation api flow didn't generate payload schema #7366

Merged
merged 6 commits into from
Dec 24, 2024

Conversation

scopsy
Copy link
Contributor

@scopsy scopsy commented Dec 24, 2024

What changed? Why was the change needed?

  • Fixes the issue where API-generated workflows are lacking the payload schema, and it only works on upsert

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

netlify bot commented Dec 24, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 3b31d03
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/676ab14cc1a20c0007ac938a
😎 Deploy Preview https://deploy-preview-7366.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

netlify bot commented Dec 24, 2024

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

Name Link
🔨 Latest commit 3b31d03
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/676ab14c854c800008ecbbb4
😎 Deploy Preview https://deploy-preview-7366.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.

@@ -62,15 +62,15 @@ export class BuildAvailableVariableSchemaUsecase {
workflow: NotificationTemplateEntity | undefined,
command: BuildAvailableVariableSchemaCommand
): Promise<JSONSchemaDto> {
if (!workflow) {
if (workflow && !workflow?.steps.length) {
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 is what caused the issue, as the workflow didn't existed here yet.

@scopsy scopsy changed the title Fix workflow creation api fix(api-service): workflow creation api flow didn't generate payload schema Dec 24, 2024
@@ -62,15 +62,15 @@ export class BuildAvailableVariableSchemaUsecase {
workflow: NotificationTemplateEntity | undefined,
command: BuildAvailableVariableSchemaCommand
): Promise<JSONSchemaDto> {
if (!workflow) {
if (workflow && !workflow?.steps.length) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (workflow && !workflow?.steps.length) {
if (workflow && workflow.steps && workflow.steps.length === 0) {

@scopsy scopsy merged commit 55f7de6 into next Dec 24, 2024
30 checks passed
@scopsy scopsy deleted the fix-workflow-creation-api branch December 24, 2024 14:44
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.

2 participants