Skip to content

fix: resolve chapter dropdown in notes & ask modal, update resource request validation - #487

Merged
trtajim merged 3 commits into
mainfrom
fix/chapters-dropdown-and-resource-update
Oct 27, 2026
Merged

trtajim merged 3 commits into
mainfrom
fix/chapters-dropdown-and-resource-update

Conversation

@trtajim

@trtajim trtajim commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Summary of Changes

  • UpdateResourceRequest.php: Added chapter_id and updated node_id to validate against exists:chapters,id instead of the dropped nodes table, fixing the 500 error on PATCH /resources/{id}.
  • Notes/Index.vue: Updated availableChapters to read subj?.chapters || subj?.nodes || [] so that chapters populate correctly when a subject is selected.
  • AskQuestionModal.vue: Updated filteredNodes to read subj?.chapters || subj?.nodes || [] so chapter selections work properly on the Home/Feed modal.

Summary by CodeRabbit

  • Bug Fixes
    • Resource updates now accept an optional chapter selection and validate chapter references consistently.
    • Forum questions and notes now use the available chapter list when provided, with existing node lists as a fallback.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between d6a6c28 and b5b2760.

Files selected for processing: 4
  • app/Http/Controllers/ResourceController.php
  • app/Http/Requests/Resource/StoreResourceRequest.php
  • app/Http/Requests/Resource/UpdateResourceRequest.php
  • resources/js/components/resources/ResourceFormModal.vue

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4b50dea and d6a6c28.

Files selected for processing: 3
  • app/Http/Requests/Resource/UpdateResourceRequest.php
  • resources/js/components/forum/AskQuestionModal.vue
  • resources/js/pages/Notes/Index.vue

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The resource update request accepts an optional chapter_id and validates node_id against chapters.id. The forum question modal and Notes page prefer a subject’s chapters list when present, with nodes as fallback.

Changes: Chapter support

Layer / File(s) Summary
Chapter reference validation
app/Http/Requests/Resource/UpdateResourceRequest.php
The request accepts an optional nullable chapter_id that must exist in chapters.id. The node_id rule now checks chapters.id.
Subject chapter options
resources/js/components/forum/AskQuestionModal.vue, resources/js/pages/Notes/Index.vue
Both subject types accept an optional chapters list. The forum modal and Notes page use that list when present and otherwise fall back to nodes.

Priority: Pending latest changes

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · previous review d6a6c

The reviewed changes have no established merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately and concisely summarizes both main changes: chapter dropdown fixes and resource request validation updates.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@trtajim
trtajim merged commit 0a1e9c0 into main Oct 27, 2026
6 checks passed
@trtajim
trtajim deleted the fix/chapters-dropdown-and-resource-update branch October 27, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant