Skip to content

Commit

Permalink
API Configuration params changes (#99)
Browse files Browse the repository at this point in the history
* Params changes

* Refactored
  • Loading branch information
m-o-n-i-s-h committed Feb 23, 2024
1 parent 9bf41be commit f510b51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/chart/table/TableChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export const NeoTableChart = (props: ChartProps) => {
const appendParams = new URLSearchParams();

if (params) {
params.forEach((param) => appendParams.append(param.key, param.value));
params.forEach((param) => appendParams.append(param.key, props.getGlobalParameter(param.value)));
}

try {
Expand All @@ -268,7 +268,7 @@ export const NeoTableChart = (props: ChartProps) => {
response = await api.get(endpoint, appendParams);
break;
case 'POST':
response = await api.post(endpoint, rows);
response = await api.post(endpoint, rows, { params: appendParams });
break;
case 'PUT':
response = await api.put(endpoint, rows);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/apiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class ApiService {
return this.axiosInstance.get(url, { params });
}

public post<T>(url: string, data?: object): Promise<AxiosResponse<T>> {
return this.axiosInstance.post(url, data);
public post<T>(url: string, data?: object, options?: object): Promise<AxiosResponse<T>> {
return this.axiosInstance.post(url, data, options);
}

public put<T>(url: string, data?: object): Promise<AxiosResponse<T>> {
Expand Down

0 comments on commit f510b51

Please sign in to comment.