🩹 ooconnector: using user token for post to backend (#525)

This commit is contained in:
Eric Doughty-Papassideris
2024-09-15 01:19:05 +02:00
parent 22f04a5eeb
commit 1d81c94d47
4 changed files with 12 additions and 8 deletions
@@ -91,7 +91,7 @@ class ApiService implements IApiService {
};
public post = async <T, R>(params: IApiServiceRequestParams<T>): Promise<R> => {
const { url, payload, headers } = params;
const { url, token, payload, headers } = params;
const axiosWithToken = await this.requireAxios();
@@ -99,6 +99,7 @@ class ApiService implements IApiService {
return await axiosWithToken.post(url, payload, {
headers: {
...headers,
...(token ? { Authorization: `Bearer ${token}` } : {}),
},
});
} catch (error) {