Skip to content

fix: filter deleted blocks from adminJourney query#8902

Open
tataihono wants to merge 1 commit intomainfrom
00-00-MA-fix-deleted-blocks-filter
Open

fix: filter deleted blocks from adminJourney query#8902
tataihono wants to merge 1 commit intomainfrom
00-00-MA-fix-deleted-blocks-filter

Conversation

@tataihono
Copy link
Contributor

@tataihono tataihono commented Mar 24, 2026

Summary

  • The blocks relation on the Journey type in api-journeys-modern was returning all blocks including soft-deleted ones (deletedAt != null)
  • The legacy api-journeys resolver correctly filtered these with deletedAt: null — this was missed during the port
  • Adds query: () => ({ where: { deletedAt: null } }) to the blocks relation, consistent with all other block queries in the codebase

Test plan

  • Verify adminJourney query no longer returns blocks with non-null deletedAt
  • Verify block delete/restore undo functionality still works (uses separate mutation, not this relation)
  • Verify journey editor loads blocks correctly

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where deleted blocks were appearing in journey data. Deleted blocks are now properly excluded from results.

The blocks relation on Journey type in api-journeys-modern was returning
all blocks including soft-deleted ones (deletedAt != null). The legacy
api-journeys resolver correctly filtered these out. This aligns the new
API with the old behavior and with other block queries in the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nx-cloud
Copy link

nx-cloud bot commented Mar 24, 2026

View your CI Pipeline Execution ↗ for commit b179485

Command Status Duration Result
nx affected --target=subgraph-check --base=10cf... ✅ Succeeded 1s View ↗
nx affected --target=extract-translations --bas... ✅ Succeeded <1s View ↗
nx affected --target=lint --base=10cfcbb6fca1e8... ✅ Succeeded 21s View ↗
nx affected --target=type-check --base=10cfcbb6... ✅ Succeeded 18s View ↗
nx run-many --target=codegen --all --parallel=3 ✅ Succeeded 2s View ↗
nx run-many --target=prisma-generate --all --pa... ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-24 01:19:30 UTC

@tataihono tataihono requested a review from mikeallisonJS March 24, 2026 01:17
@tataihono tataihono self-assigned this Mar 24, 2026
@stage-branch-merger
Copy link

I see you added the "on stage" label, I'll get this merged to the stage branch!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7751f246-02b0-43ce-811f-ad8eb91fce54

📥 Commits

Reviewing files that changed from the base of the PR and between 10cfcbb and b179485.

📒 Files selected for processing (1)
  • apis/api-journeys-modern/src/schema/journey/journey.ts

Walkthrough

The JourneyRef schema relation blocks is updated to filter out soft-deleted blocks by adding a query constraint that excludes records where deletedAt is not null. The relation remains nullable and otherwise unchanged.

Changes

Cohort / File(s) Summary
Schema Relation Filtering
apis/api-journeys-modern/src/schema/journey/journey.ts
Updated blocks relation on JourneyRef to include query: () => ({ where: { deletedAt: null } }), filtering out soft-deleted blocks while maintaining nullable designation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: filtering deleted blocks from the adminJourney query by applying a deletedAt null constraint to the blocks relation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 00-00-MA-fix-deleted-blocks-filter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant