Skip to content

Fix error in example code for Best Practice page#815

Open
KhamzaKhakim wants to merge 1 commit intoelysiajs:mainfrom
KhamzaKhakim:best-practice-errors
Open

Fix error in example code for Best Practice page#815
KhamzaKhakim wants to merge 1 commit intoelysiajs:mainfrom
KhamzaKhakim:best-practice-errors

Conversation

@KhamzaKhakim
Copy link

@KhamzaKhakim KhamzaKhakim commented Mar 13, 2026

Due to the previous removal of namespaces from the example folder structure, new errors arose in the service and controller files, which have been fixed.
https://elysiajs.com/essential/best-practice.html#folder-structure

Not sure if accessing types like AuthModel["signInBody"] is the preferred approach though — happy to hear any thoughts.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

Walkthrough

Documentation file updated to revise type access patterns from dot notation to bracket notation for AuthModel properties and add an export modifier to the AuthModel constant declaration.

Changes

Cohort / File(s) Summary
Documentation Updates
docs/essential/best-practice.md
Type access syntax changed from dot notation (AuthModel.signInBody, AuthModel.signInInvalid) to bracket notation (AuthModel['signInBody'], AuthModel['signInInvalid']). AuthModel constant declaration updated to be exported.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A doc update so neat and so fine,
Brackets replace dots in each line,
Export the model with care,
Type access improved everywhere,
TypeScript syntax now shines divine! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing errors in example code for the Best Practice page, which aligns with the actual modifications to the documentation file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.

Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present.

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