Skip to content

Commit

Permalink
code changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
anujsi committed Jul 24, 2019
2 parents 96b8a28 + 468c670 commit 5451ac9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "stratajs",
"description": "JavaScript Library to interact with the Red Hat Customer Portal API",
"version": "1.6.5",
"version": "1.6.9",
"main": "strata.js",
"repository": {
"type": "git",
Expand Down
53 changes: 29 additions & 24 deletions strata.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
addCaseSbrs,
removeCaseSbrs;

strata.version = '1.6.4';
strata.version = '1.6.8';
redhatClientID = 'stratajs-' + strata.version;

function getIsTokenExpired() {
Expand Down Expand Up @@ -1116,35 +1116,39 @@
url.addQueryParam('partnerSearch', partnerSearch);
caseFields && caseFields.length > 0 && url.addQueryParam('fl', caseFields.join(','));

const mapResponse = (caseDocs, totalCases) => ({
total_count: totalCases,
case: caseDocs.map((kase) => $.extend({}, kase, {
created_by: kase.case_createdByName,
created_date: kase.case_createdDate,
last_modified_by: kase.case_lastModifiedByName,
last_modified_date: kase.case_lastModifiedDate,
summary: kase.case_summary,
status: kase.case_status,
product: kase.case_product[0],
version: kase.case_version,
account_number: kase.case_accountNumber,
contact_name: kase.case_contactName,
owner: kase.case_owner,
severity: kase.case_severity,
last_public_update_at: kase.case_last_public_update_date,
last_public_update_by: kase.case_last_public_update_by,
case_number: kase.case_number,
folder_name: kase && kase.case_folderName ? kase.case_folderName : ''
}))
});
var mapResponse = function (caseDocs, totalCases) {
return ({
total_count: totalCases,
case: caseDocs.map(function (kase) {
return $.extend({}, kase, {
created_by: kase.case_createdByName,
created_date: kase.case_createdDate,
last_modified_by: kase.case_lastModifiedByName,
last_modified_date: kase.case_lastModifiedDate,
summary: kase.case_summary,
status: kase.case_status,
product: kase.case_product[0],
version: kase.case_version,
account_number: kase.case_accountNumber,
contact_name: kase.case_contactName,
owner: kase.case_owner,
severity: kase.case_severity,
last_public_update_at: kase.case_last_public_update_date,
last_public_update_by: kase.case_last_public_update_by,
case_number: kase.case_number,
folder_name: kase && kase.case_folderName ? kase.case_folderName : ''
})
})
});
};

searchCases = handleJWTandCallAjax({
headers: {
Accept: 'application/vnd.redhat.solr+json'
},
url: url,
success: function (res) {
const response = mapResponse(res.response.docs, res.response.numFound);
var response = mapResponse(res.response.docs, res.response.numFound);
if (response['case'] !== undefined) {
response['case'].forEach(convertDates);
onSuccess(response);
Expand Down Expand Up @@ -1176,7 +1180,8 @@
if (order != null) {
url.addQueryParam('sort', order);
}
const ajaxParams = {

var ajaxParams = {
url: url,
success: function (response) {
if (format == 'csv') {
Expand Down

0 comments on commit 5451ac9

Please sign in to comment.