Skip to content

Commit

Permalink
Removed callback query parameter #99
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeTschudi committed Dec 13, 2018
1 parent f58d59f commit f330466
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 4 additions & 7 deletions js/app/dataAccess.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ define(['diag'], function (diag) {
deferred = $.Deferred();

url = dataAccess.featureServiceUrl + "query?where=" + (condition || dataAccess.validCandidateCondition)
+ "&objectIds=&returnIdsOnly=false&returnCountOnly=true&outFields=" + dataAccess.fixedQueryParams
+ "&callback=?";
+ "&objectIds=&returnIdsOnly=false&returnCountOnly=true&outFields=" + dataAccess.fixedQueryParams;
$.getJSON(url, function handleObjectCountClosure(results) {
dataAccess.handleObjectCount(results, deferred, condition);
});
Expand Down Expand Up @@ -166,8 +165,7 @@ define(['diag'], function (diag) {

// Get the ids of available unsurveyed candidates
url = dataAccess.featureServiceUrl + "query?where=" + dataAccess.validCandidateCondition
+ "&objectIds=&returnIdsOnly=true&returnCountOnly=false&outFields=" + dataAccess.fixedQueryParams
+ "&callback=?";
+ "&objectIds=&returnIdsOnly=true&returnCountOnly=false&outFields=" + dataAccess.fixedQueryParams;
$.post(url, function handleCandidatesClosure(results) {
dataAccess.handleCandidates(results, randomizeSelection, deferred);
},'json');
Expand Down Expand Up @@ -210,15 +208,14 @@ define(['diag'], function (diag) {
// Get the candidate's attributes
attributesDeferred = $.Deferred();
objectAttrsUrl = dataAccess.featureServiceUrl + "query?objectIds=" + objectId
+ "&returnIdsOnly=false&returnCountOnly=false&outFields=*" + dataAccess.fixedQueryParams
+ "&callback=?";
+ "&returnIdsOnly=false&returnCountOnly=false&outFields=*" + dataAccess.fixedQueryParams;
$.getJSON(objectAttrsUrl, function handleCandidateAttrsClosure(results) {
dataAccess.handleCandidateAttrs(results, attributesDeferred);
});

// Get the candidate's attachments
attachmentsDeferred = $.Deferred();
objectAttachmentsUrl = dataAccess.featureServiceUrl + objectId + "/attachments?f=json&callback=?";
objectAttachmentsUrl = dataAccess.featureServiceUrl + objectId + "/attachments?f=json";
$.getJSON(objectAttachmentsUrl, function handleCandidateAttachmentsClosure(results) {
dataAccess.handleCandidateAttachments(objectId, results, attributesDeferred, attachmentsDeferred);
});
Expand Down
8 changes: 4 additions & 4 deletions js/app/fetchConfigInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ define(['parseConfigInfo'], function (parseConfigInfo) {
}

if (parseConfigInfo.isUsableString(appId)) {
$.getJSON(arcgisUrl + appId + "/data?f=json&callback=?", function (data) {
$.getJSON(arcgisUrl + appId + "/data?f=json", function (data) {
deferred.resolve((data && data.values) || {});
});
} else {
Expand Down Expand Up @@ -103,7 +103,7 @@ define(['parseConfigInfo'], function (parseConfigInfo) {
deferreds.origImageUrl = origImageUrlDeferred || $.Deferred();

if (parseConfigInfo.isUsableString(webmapId)) {
$.getJSON(arcgisUrl + webmapId + "?f=json&callback=?", function (data) {
$.getJSON(arcgisUrl + webmapId + "?f=json", function (data) {
var normalizedData = {}, imageUrl, iExt;
if (!data || data.error) {
deferreds.params.reject();
Expand Down Expand Up @@ -161,7 +161,7 @@ define(['parseConfigInfo'], function (parseConfigInfo) {
}

if (parseConfigInfo.isUsableString(webmapId)) {
$.getJSON(arcgisUrl + webmapId + "/data?f=json&callback=?", function (data) {
$.getJSON(arcgisUrl + webmapId + "/data?f=json", function (data) {
var featureSvcData = {};

if (data && data.operationalLayers && data.operationalLayers.length > 0 && data.tables && data.tables.length > 0) {
Expand Down Expand Up @@ -207,7 +207,7 @@ define(['parseConfigInfo'], function (parseConfigInfo) {
deferred = $.Deferred();
}
if (parseConfigInfo.isUsableString(featureSvcUrl)) {
$.getJSON(featureSvcUrl + "?f=json&callback=?", function (data) {
$.getJSON(featureSvcUrl + "?f=json", function (data) {
data.canBeUpdated = data.capabilities && data.capabilities.indexOf("Update") >= 0;
deferred.resolve(data);
});
Expand Down

0 comments on commit f330466

Please sign in to comment.