Skip to content

fix: match frontend status enum with backend (#218) - #233

Merged
johanbriger merged 2 commits into
mainfrom
218-frontend-använder-statusvärdet-awaiting_test_results-som-inte-finns-i-backend-fix-för-frontend-att-matcha-backend-enumet
Apr 23, 2026

Hidden character warning

The head ref may contain hidden characters: "218-frontend-anv\u00e4nder-statusv\u00e4rdet-awaiting_test_results-som-inte-finns-i-backend-fix-f\u00f6r-frontend-att-matcha-backend-enumet"
Merged

fix: match frontend status enum with backend (#218)#233
johanbriger merged 2 commits into
mainfrom
218-frontend-använder-statusvärdet-awaiting_test_results-som-inte-finns-i-backend-fix-för-frontend-att-matcha-backend-enumet

Conversation

@johanbriger

@johanbriger johanbriger commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Closes #218

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the status value mapping for the "Waiting for test results" option in the case status selection interface for veterinarians.

@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@johanbriger has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 51 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 53 minutes and 51 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 15b3f7cc-db17-4793-9fb6-9058e8cbf700

📥 Commits

Reviewing files that changed from the base of the PR and between 5be326f and 75b99d7.

📒 Files selected for processing (1)
  • frontend/src/pages/CaseDetail.jsx
📝 Walkthrough

Walkthrough

A single-line bug fix in the case detail status dropdown that changes the enum value from AWAITING_TEST_RESULTS to AWAITING_INFO to align with the backend's RecordStatus enum, resolving 400 Bad Request errors when selecting "Väntar på provsvar".

Changes

Cohort / File(s) Summary
Status Enum Alignment
frontend/src/pages/CaseDetail.jsx
Changed status dropdown option value from non-existent AWAITING_TEST_RESULTS to correct backend enum value AWAITING_INFO for the "Väntar på provsvar" option.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A single line, a typo's plight,
AWAITING_TEST became AWAITING_INFO—just right!
Backend and frontend now sing in tune,
No more 400 errors to swoon.
Status flows smooth beneath the moon! 🌙

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR modifies only one line in CaseDetail.jsx to replace AWAITING_TEST_RESULTS with AWAITING_INFO, meeting the primary fix requirement but not fully addressing all acceptance criteria. The PR must search the entire frontend codebase to ensure no other occurrences of AWAITING_TEST_RESULTS exist, as required by acceptance criteria and issue step 3.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title accurately summarizes the main change: replacing AWAITING_TEST_RESULTS with AWAITING_INFO to match backend enum.
Out of Scope Changes check ✅ Passed The single-line change directly addresses the linked issue without introducing unrelated modifications.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 218-frontend-använder-statusvärdet-awaiting_test_results-som-inte-finns-i-backend-fix-för-frontend-att-matcha-backend-enumet

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/src/pages/CaseDetail.jsx`:
- Line 211: The dropdown option for value "AWAITING_INFO" in CaseDetail.jsx
currently shows "Väntar på provsvar" which is inconsistent with
STATUS_MAP['AWAITING_INFO'].label ("Väntar på svar"); update the option so it
uses the same source as the header badge (either render
STATUS_MAP['AWAITING_INFO'].label or statusConfig.label where appropriate) or
change the hardcoded string to "Väntar på svar" to ensure the dropdown and case
detail view display identical labels for AWAITING_INFO.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4433681c-23cf-4f22-a8dd-ba2d1be16f30

📥 Commits

Reviewing files that changed from the base of the PR and between 86978a3 and 5be326f.

📒 Files selected for processing (1)
  • frontend/src/pages/CaseDetail.jsx

Comment thread frontend/src/pages/CaseDetail.jsx Outdated
@johanbriger
johanbriger merged commit 0f8a5cf into main Apr 23, 2026
2 checks passed
@johanbriger
johanbriger deleted the 218-frontend-använder-statusvärdet-awaiting_test_results-som-inte-finns-i-backend-fix-för-frontend-att-matcha-backend-enumet branch April 23, 2026 06:35
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.

Frontend använder statusvärdet AWAITING_TEST_RESULTS som inte finns i backend fix för frontend att matcha backend-enumet

1 participant