gd-sprest
Advanced tools
Comparing version 8.1.3 to 8.1.4
@@ -225,8 +225,43 @@ "use strict"; | ||
} | ||
// Query the field links | ||
// Query the fields | ||
ct.query({ | ||
Expand: ["Fields", "FieldLinks"], | ||
Select: [ | ||
"FieldLinks/DisplayName", "FieldLinks/Id", "FieldLinks/Name", | ||
"FieldLinks/Required", "FieldLinks/ReadOnly", "FieldLinks/ShowInDisplayForm", | ||
"Fields/InternalName", "Fields/IsDependentLookup" | ||
] | ||
}).execute(function (ct) { | ||
var fieldRefs = []; | ||
// Associated lookup fields error when removing from content types | ||
// They may get removed when removing the main lookup field | ||
// Parse the field links | ||
for (var i = 0; i < ct.FieldLinks.results.length; i++) { | ||
var addField = true; | ||
var fieldLink = ct.FieldLinks.results[i]; | ||
// Find the field | ||
for (var j = 0; j < ct.Fields.results.length; j++) { | ||
var field = ct.Fields.results[j]; | ||
// See if this is the target field | ||
if (field.InternalName == fieldLink.Name) { | ||
// See if this is an associated lookup field | ||
if (field.IsDependentLookup) { | ||
// Set the flag | ||
addField = false; | ||
} | ||
// Break from the loop | ||
break; | ||
} | ||
} | ||
// Add the field link | ||
if (addField) { | ||
fieldRefs.push(fieldLink); | ||
} | ||
} | ||
// Resolve the request | ||
resolve(fieldRefs); | ||
}, reject); | ||
ct.FieldLinks().query({ | ||
Select: ["DisplayName", "Id", "Name", "Required", "ReadOnly", "ShowInDisplayForm"] | ||
}).execute(function (fieldLinks) { | ||
// Resolve the request | ||
resolve(fieldLinks.results); | ||
}, reject); | ||
@@ -233,0 +268,0 @@ }); |
@@ -12,3 +12,3 @@ "use strict"; | ||
exports.$REST = { | ||
__ver: 8.13, | ||
__ver: 8.14, | ||
AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); }, | ||
@@ -15,0 +15,0 @@ Apps: Lib.Apps, |
{ | ||
"name": "gd-sprest", | ||
"version": "8.1.3", | ||
"version": "8.1.4", | ||
"description": "An easy way to develop against the SharePoint REST API.", | ||
@@ -5,0 +5,0 @@ "author": "Gunjan Datta <me@dattabase.com> (https://gunjandatta.github.io)", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2577244
31395