Skip to content

Commit

Permalink
chore: add token to cart request
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-zeynal committed Nov 26, 2023
1 parent 8a9d998 commit a88c77c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/providers/APIProvider/APIProvider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ export function APIProvider({children}) {
}

console.log(body)
const tokenStr = JSON.parse(localStorage.getItem('user'))['access']
await service.post(`${URL.baseURL}${URL.services.default}${endpoint}`,
body)
body, {headers: {"Authorization" : `Bearer ${tokenStr}`}})
.then(response => {
setAddToCartResponse(response)
})
Expand Down

0 comments on commit a88c77c

Please sign in to comment.