Skip to content

Commit

Permalink
Add numeral package and neccessary changes written into axios
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkan1 committed May 4, 2024
1 parent aa20732 commit 7aea73b
Show file tree
Hide file tree
Showing 8 changed files with 1,101 additions and 96 deletions.
86 changes: 0 additions & 86 deletions client/app/lib/value-format.js

This file was deleted.

9 changes: 7 additions & 2 deletions client/app/services/query-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { QueryResultError } from "@/services/query";
import { Auth } from "@/services/auth";
import { isString, uniqBy, each, isNumber, includes, extend, forOwn, get } from "lodash";

const JSONbigString = require('json-bigint')({ storeAsString: true });
const logger = debug("redash:services:QueryResult");
const filterTypes = ["filter", "multi-filter", "multiFilter"];

Expand Down Expand Up @@ -45,7 +46,9 @@ function getColumnFriendlyName(column) {

const createOrSaveUrl = data => (data.id ? `api/query_results/${data.id}` : "api/query_results");
const QueryResultResource = {
get: ({ id }) => axios.get(`api/query_results/${id}`),
get: ({ id }) => axios.get(`api/query_results/${id}`, {
transformResponse: (response) => JSONbigString.parse(response)
}),
post: data => axios.post(createOrSaveUrl(data), data),
};

Expand Down Expand Up @@ -335,7 +338,9 @@ class QueryResult {
queryResult.deferred.onStatusChange(ExecutionStatus.LOADING_RESULT);

axios
.get(`api/queries/${queryId}/results/${id}.json`)
.get(`api/queries/${queryId}/results/${id}.json`, {
transformResponse: (response) => JSONbigString.parse(response)
})
.then(response => {
// Success handler
queryResult.isLoadingResult = false;
Expand Down
9 changes: 7 additions & 2 deletions client/app/services/report-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { QueryResultError } from "@/services/query";
import { Auth } from "@/services/auth";
import { isString, uniqBy, each, isNumber, includes, extend, forOwn, get } from "lodash";

const JSONbigString = require('json-bigint')({ storeAsString: true });
const logger = debug("redash:services:QueryResult");
const filterTypes = ["filter", "multi-filter", "multiFilter"];

Expand Down Expand Up @@ -45,7 +46,9 @@ function getColumnFriendlyName(column) {

const createOrSaveUrl = data => (data.id ? `api/query_results/${data.id}` : "api/query_results");
const QueryResultResource = {
get: ({ id }) => axios.get(`api/query_results/${id}`),
get: ({ id }) => axios.get(`api/query_results/${id}`, {
transformResponse: (response) => JSONbigString.parse(response)
}),
post: data => axios.post(createOrSaveUrl(data), data),
};

Expand Down Expand Up @@ -333,7 +336,9 @@ class QueryResult {
queryResult.deferred.onStatusChange(ExecutionStatus.LOADING_RESULT);

axios
.get(`api/queries/${queryId}/results/${id}.json`)
.get(`api/queries/${queryId}/results/${id}.json`, {
transformResponse: (response) => JSONbigString.parse(response)
})
.then(response => {
// Success handler
queryResult.isLoadingResult = false;
Expand Down
15 changes: 15 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"immutable": "4.0.0-rc.9",
"immutable-class": "0.9.8",
"js-cookie": "^2.2.1",
"json-bigint": "^1.0.0",
"lodash": "^4.17.20",
"lz-string": "^1.4.4",
"markdown": "0.5.0",
Expand Down
Loading

0 comments on commit 7aea73b

Please sign in to comment.