Skip to content

Commit e05de49

Browse files
Release v1.2.7
1 parent a1efac2 commit e05de49

File tree

6 files changed

+30
-12
lines changed

6 files changed

+30
-12
lines changed

dist/dwa.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! dwa v1.2.6 (c) 2017 Aleksandr Rogov */
1+
/*! dwa v1.2.7 (c) 2017 Aleksandr Rogov */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();

dist/dynamics-web-api-callbacks.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! dynamics-web-api-callbacks v1.2.6 (c) 2017 Aleksandr Rogov */
1+
/*! dynamics-web-api-callbacks v1.2.7 (c) 2017 Aleksandr Rogov */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -345,8 +345,17 @@ module.exports = function sendRequest(method, uri, config, data, additionalHeade
345345
if (data) {
346346
stringifiedData = JSON.stringify(data, function (key, value) {
347347
/// <param name="key" type="String">Description</param>
348-
if (key.endsWith("@odata.bind") && typeof value === "string" && !value.startsWith(config.webApiUrl)) {
349-
value = config.webApiUrl + value;
348+
if (key.endsWith("@odata.bind")) {
349+
if (typeof value === "string") {
350+
//remove brackets in guid
351+
if (/\(\{[\w\d-]+\}\)/g.test(value)){
352+
value = value.replace(/(.+)\(\{([\w\d-]+)\}\)/g, '$1($2)');
353+
}
354+
//add full web api url if it's not set
355+
if (!value.startsWith(config.webApiUrl)) {
356+
value = config.webApiUrl + value;
357+
}
358+
}
350359
}
351360

352361
return value;

dist/dynamics-web-api-callbacks.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dynamics-web-api.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! dynamics-web-api v1.2.6 (c) 2017 Aleksandr Rogov */
1+
/*! dynamics-web-api v1.2.7 (c) 2017 Aleksandr Rogov */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -345,8 +345,17 @@ module.exports = function sendRequest(method, uri, config, data, additionalHeade
345345
if (data) {
346346
stringifiedData = JSON.stringify(data, function (key, value) {
347347
/// <param name="key" type="String">Description</param>
348-
if (key.endsWith("@odata.bind") && typeof value === "string" && !value.startsWith(config.webApiUrl)) {
349-
value = config.webApiUrl + value;
348+
if (key.endsWith("@odata.bind")) {
349+
if (typeof value === "string") {
350+
//remove brackets in guid
351+
if (/\(\{[\w\d-]+\}\)/g.test(value)){
352+
value = value.replace(/(.+)\(\{([\w\d-]+)\}\)/g, '$1($2)');
353+
}
354+
//add full web api url if it's not set
355+
if (!value.startsWith(config.webApiUrl)) {
356+
value = config.webApiUrl + value;
357+
}
358+
}
350359
}
351360

352361
return value;

dist/dynamics-web-api.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dynamics-web-api",
3-
"version": "1.2.6",
3+
"version": "1.2.7",
44
"description": "DynamicsWebApi is a Microsoft Dynamics CRM Web API helper library",
55
"keywords": [
66
"crm",

0 commit comments

Comments
 (0)