Skip to content

Commit

Permalink
fix: use getAccessTokenHeader in payment api
Browse files Browse the repository at this point in the history
  • Loading branch information
KimiaMontazeri committed Nov 28, 2023
1 parent 8aa80dd commit 5dfa7fb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/providers/APIProvider/APIProvider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,17 @@ export function APIProvider({ children }) {

const postPaymentData = useCallback(
async (data) => {
const tokenStr = JSON.parse(localStorage.getItem('user'))['access'];
await service
.post(`${URL.baseURL}${URL.endpoints.payment.default}`, data, {
headers: {
Authorization: `Bearer ${tokenStr}`,
Authorization: getAccessTokenHeader(),
},
})
.then((response) => {
setPaymentData(response.data);
});
},
[currentYear, service],
[currentYear, service, getAccessTokenHeader],
);

const activateUser = useCallback(async () => {
Expand Down

0 comments on commit 5dfa7fb

Please sign in to comment.