Added editing session key to the connector services

This commit is contained in:
Anton SHEPILOV
2024-08-25 22:26:28 +02:00
committed by Eric Doughty-Papassideris
parent 7941ba2e1f
commit d94ec46e1d
8 changed files with 97 additions and 16 deletions
@@ -49,6 +49,26 @@ class ApiService implements IApiService {
return await axiosWithToken.get(url, config);
};
public delete = async <T>(params: IApiServiceRequestParams<T>): Promise<T> => {
const { url, token, responseType, headers } = params;
const axiosWithToken = await this.requireAxios();
const config: AxiosRequestConfig = {};
if (token) {
config['headers'] = {
Authorization: `Bearer ${token}`,
...headers,
};
}
if (responseType) {
config['responseType'] = responseType;
}
return await axiosWithToken.delete(url, config);
};
public post = async <T, R>(params: IApiServiceRequestParams<T>): Promise<R> => {
const { url, payload, headers } = params;