mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Update Mesh.js to allow for running AWX at non-root path (URL prefixing) (#14020)
Co-authored-by: Michael Abashian <mabashia@redhat.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import Base from '../Base';
|
||||
class JobEvents extends Base {
|
||||
constructor(http) {
|
||||
super(http);
|
||||
this.baseUrl = '/api/v2/job_events/';
|
||||
this.baseUrl = 'api/v2/job_events/';
|
||||
}
|
||||
|
||||
readChildren(id, params) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import Base from '../Base';
|
||||
class Mesh extends Base {
|
||||
constructor(http) {
|
||||
super(http);
|
||||
this.baseUrl = '/api/v2/mesh_visualizer/';
|
||||
this.baseUrl = 'api/v2/mesh_visualizer/';
|
||||
}
|
||||
}
|
||||
export default Mesh;
|
||||
|
||||
@@ -4,7 +4,7 @@ class Root extends Base {
|
||||
constructor(http) {
|
||||
super(http);
|
||||
this.baseUrl = 'api/';
|
||||
this.redirectURL = '/api/v2/config/';
|
||||
this.redirectURL = 'api/v2/config/';
|
||||
}
|
||||
|
||||
async login(username, password, redirect = this.redirectURL) {
|
||||
|
||||
@@ -35,7 +35,7 @@ describe('RootAPI', () => {
|
||||
|
||||
expect(mockHttp.post).toHaveBeenCalledTimes(2);
|
||||
expect(mockHttp.post.mock.calls[0]).toContainEqual(
|
||||
'username=foo&password=bar&next=%2Fapi%2Fv2%2Fconfig%2F'
|
||||
'username=foo&password=bar&next=api%2Fv2%2Fconfig%2F'
|
||||
);
|
||||
expect(mockHttp.post.mock.calls[1]).toContainEqual(
|
||||
'username=foo&password=bar&next=baz'
|
||||
|
||||
Reference in New Issue
Block a user