Skip to content

Commit

Permalink
fix(RHINENG-3395): Update Patch API to v3 (#2100)
Browse files Browse the repository at this point in the history
  • Loading branch information
leSamo authored Nov 22, 2023
1 parent 8f3c9d8 commit 198049d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/api/systemIssues.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const cves = async (systemId) => {

export const patch = async (systemId) => {
try {
return await instance.get(`/api/patch/v1/systems/${systemId}`);
return await instance.get(`/api/patch/v3/systems/${systemId}`);
} catch (_e) {
return {};
}
Expand Down
4 changes: 2 additions & 2 deletions src/api/systemIssues.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { advisor, compliance, cves, patch } from './systemIssues';

describe('patch', () => {
it('should perform get call', async () => {
mock.onGet('/api/patch/v1/systems/test-id').replyOnce(200, 'test');
mock.onGet('/api/patch/v3/systems/test-id').replyOnce(200, 'test');
const data = await patch('test-id');
expect(data).toBe('test');
});

it('should not fail', async () => {
mock.onGet('/api/patch/v1/systems/test-id').reply(500);
mock.onGet('/api/patch/v3/systems/test-id').reply(500);
const data = await patch('test-id');
expect(data).toMatchObject({});
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/InventoryDetail/DetailWrapper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { mock } from '../../__mocks__/systemIssues';
import InsightsDisconnected from '../../Utilities/InsightsDisconnected';

describe('DetailWrapper', () => {
mock.onGet('/api/patch/v1/systems/test-id').reply(200, 'test');
mock.onGet('/api/patch/v3/systems/test-id').reply(200, 'test');
mock.onGet('/api/insights/v1/system/test-id/reports/').reply(200, 'test');
mock
.onGet(
Expand Down
2 changes: 1 addition & 1 deletion src/components/InventoryDetailDrawer/SystemIssues.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { mock } from '../../__mocks__/systemIssues';
describe('SystemIssues', () => {
let initialState;
let mockStore;
mock.onGet('/api/patch/v1/systems/test-id').reply(200, 'test');
mock.onGet('/api/patch/v3/systems/test-id').reply(200, 'test');
mock.onGet('/api/insights/v1/system/test-id/reports/').reply(200, 'test');
mock
.onGet(
Expand Down

0 comments on commit 198049d

Please sign in to comment.