refactor: replace CoreWebService with HttpClient in various services#34165
Open
refactor: replace CoreWebService with HttpClient in various services#34165
Conversation
### Summary This commit refactors multiple services to replace the deprecated CoreWebService with Angular's HttpClient for making HTTP requests. The changes enhance code clarity and maintainability by utilizing Angular's built-in HTTP capabilities. ### Changes Made - Updated services to use HttpClient for GET, POST, PUT, and DELETE requests. - Replaced operator with for extracting response data. - Ensured all services maintain their original functionality while improving type safety and reducing boilerplate code. ### Impact This refactor improves the overall architecture by promoting the use of Angular's HttpClient, aligning with best practices for modern Angular development. ### Testing All affected services have been tested to ensure that they function correctly with the new implementation. ### Checklist - [x] Code compiles without errors - [x] Documentation updated - [x] Linting & formatting applied - [x] Ready for review
…ice and DotTemplatesService
…or improved clarity and maintainability
…with provideHttpClient and provideHttpClientTesting for improved clarity and maintainability
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors multiple Angular services to replace the deprecated CoreWebService with Angular's native HttpClient. The migration involves approximately 40+ service files and their corresponding test files, updating URL formats, replacing the deprecated pluck operator with map, and modernizing test patterns.
Key Changes:
- Migrated from
CoreWebServiceto Angular'sHttpClientfor HTTP requests - Normalized API URLs to include
/api/prefix (e.g.,v1/users→/api/v1/users) - Replaced
pluckoperator withmapfor response data extraction - Updated test files to use
provideHttpClient()andprovideHttpClientTesting()instead of deprecatedHttpClientTestingModule - Added comprehensive migration documentation
Reviewed changes
Copilot reviewed 73 out of 73 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
dot-request-response.model.ts |
Added new DotCMSResponseJsonObject interface for bodyJsonObject responses |
core-web-service-migration.md |
Added comprehensive migration guide with patterns and examples (610 lines) |
core-web.service.ts |
Marked DotCMSResponse as deprecated |
site.service.ts |
Migrated to HttpClient, corrected URLs, replaced pluck with map |
login.service.ts |
Migrated to HttpClient, fixed error property access, improved type safety |
dotcms-config.service.ts |
Migrated to HttpClient with proper response typing |
dot-*.service.ts (30+ files) |
Consistent migration pattern across data-access services |
*.spec.ts (40+ files) |
Modernized tests with provideHttpClient and corrected URL expectations |
dario-daza
approved these changes
Dec 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This commit refactors multiple services to replace the deprecated CoreWebService with Angular's HttpClient for making HTTP requests. The changes enhance code clarity and maintainability by utilizing Angular's built-in HTTP capabilities.
Changes Made
Impact
This refactor improves the overall architecture by promoting the use of Angular's HttpClient, aligning with best practices for modern Angular development.
Testing
All affected services have been tested to ensure that they function correctly with the new implementation.
Checklist