Skip to content

Commit

Permalink
fix: Fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Finlinson committed Feb 11, 2019
1 parent e1b1b22 commit cce41f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/webapi-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function submitRequest(config: WebApiRequestConfig,
callback: (result: WebApiRequestResult) => void): void {
const req: XMLHttpRequest = new XMLHttpRequest();

req.open(config.method, encodeURI(`${this._config.url}/${config.queryString}`), true);
req.open(config.method, encodeURI(`${config.config.url}/${config.queryString}`), true);

const headers: any = webApi.getHeaders(config);

Expand Down
2 changes: 1 addition & 1 deletion src/webapi-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { request } from "https";

function submitRequest(config: WebApiRequestConfig,
callback: (result: WebApiRequestResult) => void): void {
const url: URL = new URL(`${this._config.url}/${config.queryString}`);
const url: URL = new URL(`${config.config.url}/${config.queryString}`);

const headers: any = webApi.getHeaders(config);

Expand Down
4 changes: 2 additions & 2 deletions src/webapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export function getHeaders(config: WebApiRequestConfig): any {
headers['OData-Version'] = '4.0';
headers['Content-Type'] = config.contentType;

if (this._config.accessToken != null) {
headers.Authorization = `Bearer ${this._config.accessToken}`;
if (config.config.accessToken != null) {
headers.Authorization = `Bearer ${config.config.accessToken}`;
}

if (config.queryOptions != null && typeof(config.queryOptions) !== 'undefined') {
Expand Down

0 comments on commit cce41f4

Please sign in to comment.