diff --git a/README.md b/README.md index ad5833b..b80c5be 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ Basic configuration is based on [RequestInit](https://developer.mozilla.org/en-U "Content-Type": "multipart/mixed", }), useChangset: false, + useRelativeURLs: false, }, credentials: "omit", fragment: "value", diff --git a/src/OdataConfig.ts b/src/OdataConfig.ts index 2246759..a85696e 100644 --- a/src/OdataConfig.ts +++ b/src/OdataConfig.ts @@ -6,6 +6,10 @@ export interface OdataBatchConfig { boundaryPrefix?: string; useChangset: boolean; changsetBoundaryPrefix?: string; + /** + * When truthy, relative URL's will be used in batch elements + */ + useRelativeURLs: boolean; } export type OdataConfig = RequestInit & { diff --git a/src/__snapshots__/o.spec.ts.snap b/src/__snapshots__/o.spec.ts.snap index 3ece6be..17f94d4 100644 --- a/src/__snapshots__/o.spec.ts.snap +++ b/src/__snapshots__/o.spec.ts.snap @@ -12,6 +12,7 @@ Object { }, }, "useChangset": false, + "useRelativeURLs": false, }, "credentials": "omit", "fragment": "value", diff --git a/src/o.ts b/src/o.ts index 0040049..bd9d0fa 100644 --- a/src/o.ts +++ b/src/o.ts @@ -40,7 +40,8 @@ export function o(rootUrl: string | URL, config: OdataConfig | any = {}) { headers: new Headers({ "Content-Type": "multipart/mixed" }), - useChangset: false + useChangset: false, + useRelativeURLs: false }, credentials: "omit", fragment: "value",