Repository navigation
commit: T188 mark viewed processed UI - #50
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughPR thay thế màn hình chờ bằng trang quản lý cảnh báo tồn kho, thêm client API, tìm kiếm, phân trang, xác nhận thao tác và xử lý lỗi 401. ChangesQuản lý cảnh báo
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/services/alertService.js`:
- Around line 6-11: Thêm cấu hình timeout hợp lý vào axios client alertClient
trong alertService, giữ nguyên baseURL và headers hiện có để các request không
chờ vô hạn khi server treo hoặc phản hồi chậm.
In `@src/views/AlertsView.vue`:
- Around line 209-215: Update the Tìm and Xóa buttons and the pagination
controls in AlertsView to bind their disabled state to isLoading, preventing
searchAlerts, clearSearch, and page changes from triggering while fetchAlerts is
in progress. Preserve the existing behavior once loading completes.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f2c16bca-f909-45f2-9eaa-0aa7de0ceb13
📒 Files selected for processing (2)
src/services/alertService.jssrc/views/AlertsView.vue
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/services/alertService.js (1)
57-69: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winGiữ lại HTTP status khi response không có body.
Nếu backend trả
401hoặc500với body rỗng, điều kiện hiện tại bị bỏ qua và hàm trảstatus: 0như lỗi mạng. Với401,clearAuth()vẫn chạy nhưngAlertsViewcó thể không chuyển đến/loginvì không còn nhận được status401.Hãy kiểm tra
error.responsethay vìerror.response?.data, rồi dùng payload rỗng khi response không có data.Đề xuất sửa
- if (error.response?.data) { + if (error.response) { + const data = error.response.data || {} return { status: error.response.status, - message: error.response.data.message || fallbackMessage, - errors: error.response.data.errors || {}, + message: data.message || fallbackMessage, + errors: data.errors || {}, } }As per path instructions: “src/services/**: Kiểm tra loading/timeout/network error/HTTP error”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/services/alertService.js` around lines 57 - 69, Update the response-error handling in alertService to check for error.response rather than error.response.data, preserving the HTTP status even when the response body is empty. Use an empty payload/default message and errors object when no response data exists, while retaining the existing payload fields when data is present.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/views/AlertsView.vue`:
- Around line 209-220: Update the search and pagination controls in AlertsView,
including the buttons around searchAlerts and the controls at the referenced
later locations, to disable when either isLoading or actionState.loading is
true. Preserve the existing isLoading behavior while preventing list
interactions during handleMarkSeen/handleResolve updates.
---
Outside diff comments:
In `@src/services/alertService.js`:
- Around line 57-69: Update the response-error handling in alertService to check
for error.response rather than error.response.data, preserving the HTTP status
even when the response body is empty. Use an empty payload/default message and
errors object when no response data exists, while retaining the existing payload
fields when data is present.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: f184a233-145a-4112-8dca-13164b62b85e
📒 Files selected for processing (2)
src/services/alertService.jssrc/views/AlertsView.vue
ThienlocTran
left a comment
There was a problem hiding this comment.
Reviewed conflict resolution. Dropped /api/alerts service usage because backend exposes /api/inventory/low-stock for this screen.
check và merge code giúp tui
Summary by CodeRabbit