@qrvey/utils 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.4.6*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.4.7*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -15,11 +15,14 @@ const localization_1 = require("../../format/localization");
15
15
  * @returns a promise
16
16
  */
17
17
  function getDatasetColumns(config, qrveyid) {
18
- const lang = (0, localization_1.chooseLang)(config);
18
+ const params = {};
19
+ const lang = (0, localization_1.chooseLang)(config).replace(/^en(\-US){0,1}$/, ""); // Performance: set to undefined when lang is 'es' or 'es-US'
20
+ if (lang)
21
+ params.lang = lang;
19
22
  return Request_1.default.post(Object.assign(Object.assign({}, config), { qrveyid, endpoint: CHART_ENDPOINT_1.CHART_ENDPOINT }), "/question/list", {
20
23
  optionsAttributes: (0, getDefaultQuestionListOptionsAttributes_1.getDefaultQuestionListOptionsAttributes)(),
21
24
  extend: true,
22
- }, { lang })
25
+ }, params)
23
26
  .then(BDatasetsToUIDatasets_adapter_1.BDatasetsToUIDatasets)
24
27
  .catch((_e) => []);
25
28
  }
@@ -17,11 +17,14 @@ const QUESTION_LIST_BULK_ENDPOINT_1 = require("../constants/QUESTION_LIST_BULK_E
17
17
  */
18
18
  function getDatasetsByIds(config, qrveyids = []) {
19
19
  if (Array.isArray(qrveyids) && !(0, isEmpty_1.isEmpty)(qrveyids)) {
20
- const lang = (0, localization_1.chooseLang)(config);
20
+ const params = {};
21
+ const lang = (0, localization_1.chooseLang)(config).replace(/^en(\-US){0,1}$/, ""); // Performance: set to undefined when lang is 'es' or 'es-US';
22
+ if (lang)
23
+ params.lang = lang;
21
24
  return Request_1.default.post(Object.assign(Object.assign({}, config), { endpoint: QUESTION_LIST_BULK_ENDPOINT_1.QUESTION_LIST_BULK_ENDPOINT }), "", {
22
25
  optionsAttributes: (0, getDefaultQuestionListOptionsAttributes_1.getDefaultQuestionListOptionsAttributes)(),
23
26
  qrveyids,
24
- }, { lang })
27
+ }, params)
25
28
  .then((response) => (0, BDatasetsToUIDatasets_adapter_1.BDatasetsToUIDatasets)((response === null || response === void 0 ? void 0 : response.data) || []))
26
29
  .catch((_e) => []);
27
30
  }
@@ -9,11 +9,14 @@ import { chooseLang } from "../../format/localization";
9
9
  * @returns a promise
10
10
  */
11
11
  export function getDatasetColumns(config, qrveyid) {
12
- const lang = chooseLang(config);
12
+ const params = {};
13
+ const lang = chooseLang(config).replace(/^en(\-US){0,1}$/, ""); // Performance: set to undefined when lang is 'es' or 'es-US'
14
+ if (lang)
15
+ params.lang = lang;
13
16
  return Request.post(Object.assign(Object.assign({}, config), { qrveyid, endpoint: CHART_ENDPOINT }), "/question/list", {
14
17
  optionsAttributes: getDefaultQuestionListOptionsAttributes(),
15
18
  extend: true,
16
- }, { lang })
19
+ }, params)
17
20
  .then(BDatasetsToUIDatasets)
18
21
  .catch((_e) => []);
19
22
  }
@@ -11,11 +11,14 @@ import { QUESTION_LIST_BULK_ENDPOINT } from "../constants/QUESTION_LIST_BULK_END
11
11
  */
12
12
  export function getDatasetsByIds(config, qrveyids = []) {
13
13
  if (Array.isArray(qrveyids) && !isEmpty(qrveyids)) {
14
- const lang = chooseLang(config);
14
+ const params = {};
15
+ const lang = chooseLang(config).replace(/^en(\-US){0,1}$/, ""); // Performance: set to undefined when lang is 'es' or 'es-US';
16
+ if (lang)
17
+ params.lang = lang;
15
18
  return Request.post(Object.assign(Object.assign({}, config), { endpoint: QUESTION_LIST_BULK_ENDPOINT }), "", {
16
19
  optionsAttributes: getDefaultQuestionListOptionsAttributes(),
17
20
  qrveyids,
18
- }, { lang })
21
+ }, params)
19
22
  .then((response) => BDatasetsToUIDatasets((response === null || response === void 0 ? void 0 : response.data) || []))
20
23
  .catch((_e) => []);
21
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/index.js",