Skip to content

Conversation

@nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Dec 24, 2025

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

  • Code compiles without errors
  • Documentation updated
  • Linting & formatting applied
  • Ready for review

### 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
@nicobytes nicobytes requested a review from Copilot December 26, 2025 23:56
@nicobytes nicobytes marked this pull request as ready for review December 27, 2025 00:02
Copy link
Contributor

Copilot AI left a 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 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 CoreWebService to Angular's HttpClient for HTTP requests
  • Normalized API URLs to include /api/ prefix (e.g., v1/users/api/v1/users)
  • Replaced pluck operator with map for response data extraction
  • Updated test files to use provideHttpClient() and provideHttpClientTesting() instead of deprecated HttpClientTestingModule
  • 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

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.

2 participants