-
-
Notifications
You must be signed in to change notification settings - Fork 249
Replace MessageResponse with specific responses #2185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information. |
f820000
to
725546f
Compare
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces the generic MessageResponse
type with specific response types throughout the API. The main goals are to improve type safety and provide more meaningful response data for various operations.
Key changes include:
- Removal of generic
MessageResponse
in favor of specific response types likeTaskExecutionResponse
,TaskStatusResponse
, andBulkOperationResponse
- Addition of a new task API module with proper response typing
- Conversion of several endpoints to return
None
for operations that don't need response data - Hardcoded success messages in frontend components instead of relying on API responses
Reviewed Changes
Copilot reviewed 49 out of 54 changed files in this pull request and generated 7 comments.
Show a summary per file
File | Description |
---|---|
frontend/src/services/api/user.ts | Updated return types and removed MessageResponse imports |
frontend/src/services/api/task.ts | New task API module with typed responses |
frontend/src/services/api/rom.ts | Changed deleteRoms to return BulkOperationResponse |
frontend/src/services/api/platform.ts | Removed MessageResponse return type |
frontend/src/services/api/identity.ts | Removed MessageResponse return types |
frontend/src/services/api/config.ts | Removed MessageResponse return types |
frontend/src/services/api/collection.ts | Removed MessageResponse return types |
frontend/src/components/common/Platform/Dialog/DeletePlatform.vue | Hardcoded success message |
frontend/src/components/common/Navigation/SettingsDrawer.vue | Hardcoded logout success message |
frontend/src/components/common/Game/Dialog/DeleteRom.vue | Updated to use BulkOperationResponse data |
frontend/src/components/common/Collection/Dialog/DeleteSmartCollection.vue | Hardcoded success message |
frontend/src/components/common/Collection/Dialog/DeleteCollection.vue | Hardcoded success message |
frontend/src/components/Settings/Administration/TaskOption.vue | Updated to use new task API |
backend/endpoints/user.py | Changed delete_user and refresh_retro_achievements return types |
backend/endpoints/tasks.py | Major refactor to use specific response types |
backend/endpoints/rom.py | Updated deleteRoms to return BulkOperationResponse with error handling |
backend/endpoints/platform.py | Changed delete_platform to return None |
backend/endpoints/firmware.py | Updated delete_firmware to return BulkOperationResponse |
backend/endpoints/configs.py | Removed MessageResponse return types |
backend/endpoints/collections.py | Removed MessageResponse return types |
backend/endpoints/auth.py | Updated login/logout/password reset endpoints |
backend/endpoints/responses/init.py | Replaced MessageResponse with new response types |
Files not reviewed (5)
- frontend/src/generated/index.ts: Language not supported
- frontend/src/generated/models/BulkOperationResponse.ts: Language not supported
- frontend/src/generated/models/JobStatus.ts: Language not supported
- frontend/src/generated/models/TaskExecutionResponse.ts: Language not supported
- frontend/src/generated/models/TaskStatusResponse.ts: Language not supported
Description
Explain the changes or enhancements you are proposing with this pull request.
MessageResponse
in favor of specific response types likeTaskExecutionResponse
,TaskStatusResponse
, andBulkOperationResponse
None
for operations that don't need response dataChecklist
Please check all that apply.