Skip to content

fix(tags): use correct 'filter' query param for v2 tags API#35244

Merged
oidacra merged 3 commits intomainfrom
issue-33889-defect-tag-resource-ignores-filter-parameter-and-r
Apr 8, 2026
Merged

fix(tags): use correct 'filter' query param for v2 tags API#35244
oidacra merged 3 commits intomainfrom
issue-33889-defect-tag-resource-ignores-filter-parameter-and-r

Conversation

@oidacra
Copy link
Copy Markdown
Member

@oidacra oidacra commented Apr 7, 2026

Summary

  • Fix getTags() in DotTagsService to send filter query parameter instead of name when calling /api/v2/tags
  • The backend TagResource was updated to use @QueryParam("filter") but the frontend was still sending name, causing the API to return all tags unfiltered

Closes #33889

Acceptance Criteria

  • getTags() method sends filter param instead of name to /api/v2/tags
  • Existing test updated to verify filter param is sent
  • No regression: getSuggestions() (v1 API) continues working as before
  • No regression: getTagsPaginated() continues working (already used filter)

Test Plan

  • yarn nx test data-access — all 611 tests pass
  • Manual: In edit content, type in a tag field and verify suggestions are filtered correctly

Changed Files

File Change
libs/data-access/src/lib/dot-tags/dot-tags.service.ts:39 'name''filter'
libs/data-access/src/lib/dot-tags/dot-tags.service.spec.ts:74 Updated test expectation

This PR fixes: #33889

The getTags() method was sending 'name' as the query parameter to
/api/v2/tags, but the backend TagResource expects 'filter'.

Closes #33889
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 7, 2026

Claude finished @oidacra's task in 1m 24s —— View job


Claude finished @oidacra's task in 1m 2s —— View job


PR Review

  • Gathering context
  • Reading changed files
  • Reviewing code
  • Posting findings

The fix is correct. One thing to flag and one minor nit:

dot-tags.service.spec.ts:59 — Stale test description
The test is still called 'should get tags by name' after the param was renamed to filter. Should be 'should get tags by filter' for consistency with the rest of the changes.

dot-edit-content.service.spec.tsDotTagsService not mocked
DotTagsService is absent from the providers list in createHttpFactory (line 28–35), so the test at line 64–68 reaches through DotEditContentService into the real DotTagsService and intercepts the HTTP call at that layer. It passes, but it's inadvertently testing two service layers at once. This is a pre-existing issue not introduced by this PR — worth noting for a follow-up but not a blocker.

Everything else is clean. The parameter rename is propagated correctly across DotTagsService, DotEditContentService, and both spec files. No regressions in the v1 getSuggestions path or getTagsPaginated.

Copy link
Copy Markdown
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 PR fixes the frontend v2 tags lookup to use the backend’s expected filter query parameter when calling /api/v2/tags, restoring correct filtered tag results in the UI.

Changes:

  • Update DotTagsService.getTags() to send filter (instead of name) to /api/v2/tags.
  • Update the associated DotTagsService unit test to assert ?filter=... is used.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
core-web/libs/data-access/src/lib/dot-tags/dot-tags.service.ts Switch v2 tags search query param from name to filter.
core-web/libs/data-access/src/lib/dot-tags/dot-tags.service.spec.ts Adjust test to expect the updated filter query param.

Comment thread core-web/libs/data-access/src/lib/dot-tags/dot-tags.service.ts Outdated
Comment thread core-web/libs/data-access/src/lib/dot-tags/dot-tags.service.ts Outdated
oidacra added 2 commits April 8, 2026 09:30
…alignment

Address PR review comments: rename parameter and update JSDoc in
DotTagsService and DotEditContentService to match the v2 API 'filter'
query param. Update downstream test expectation accordingly.
@oidacra oidacra marked this pull request as ready for review April 8, 2026 13:31
@oidacra oidacra enabled auto-merge April 8, 2026 13:31
@oidacra oidacra moved this to In Review in dotCMS - Product Planning Apr 8, 2026
@oidacra oidacra self-assigned this Apr 8, 2026
@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 8, 2026

Rollback Safety Analysis

  • Read rollback-unsafe categories reference
  • Get full PR diff
  • Analyze against all unsafe categories
  • Apply label

Result: ✅ Safe To Rollback

All changes in this PR are pure frontend TypeScript — a query parameter fix in Angular services to align with the backend v2 tags API. No category from the rollback-unsafe reference applies:

Category Match?
C-1 Structural Data Model ❌ No DB changes
C-2 ES Mapping ❌ No ES changes
C-3 JSON Model Version Bump ❌ Not touched
C-4 DROP TABLE/COLUMN ❌ No SQL
H-1 One-Way Data Migration ❌ No migrations
H-2 RENAME TABLE/COLUMN ❌ No SQL
H-3 PK Restructuring ❌ No schema changes
H-4 New Field Type ❌ Not applicable
H-5 Storage Provider Change ❌ Not applicable
H-6 DROP PROCEDURE/FUNCTION ❌ No SQL
H-7 NOT NULL Without Default ❌ No schema changes
M-1 Column Type Change ❌ No SQL
M-2 Bundle Format Change ❌ Not applicable
M-3 REST/GraphQL API Contract ❌ Frontend-only client fix, no backend contract change
M-4 OSGi Interface Change ❌ No Java changes

Label added: AI: Safe To Rollback

View job run

@oidacra oidacra added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit ba1a690 Apr 8, 2026
29 checks passed
@oidacra oidacra deleted the issue-33889-defect-tag-resource-ignores-filter-parameter-and-r branch April 8, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

[DEFECT] Tag Resource ignores filter parameter and returns all tags

3 participants