Uploaded image for project: 'Red Hat Advanced Cluster Security'
  1. Red Hat Advanced Cluster Security
  2. ROX-32571

[Base Images Mgmt] Fix API response shape mismatch in addBaseImage service function

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None

      Overview:
      The addBaseImage function in the frontend service has an incorrect type annotation and response handling. The POST response is typed as BaseImageReference directly, but the backend returns CreateBaseImageReferenceResponse which wraps the BaseImageReference in a nested field.

      Technical Details:
      Backend proto defines:

      message CreateBaseImageReferenceResponse {
        BaseImageReference base_image_reference = 1;
      }
      

      Frontend currently expects response.data to be the BaseImageReference directly, but actual JSON response is:

      { "baseImageReference": { "id": "...", "baseImageRepoPath": "...", ... } }
      

      Acceptance Criteria:

      • Update addBaseImage function to correctly unwrap nested response
      • Fix TypeScript type annotation to match actual API response shape
      • Verify add base image flow still works correctly after fix

      Files to Update:

      ui/apps/platform/src/services/BaseImagesService.ts:30-37 - Fix response handling

      Notes:
      Currently "works" because the onSuccess callback doesn't use the returned data, but the type is incorrect and could cause bugs in future refactors.

              Unassigned Unassigned
              schaudhr Saif Chaudhry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: