Skip to content

Commit

Permalink
tried to fix cors error 5
Browse files Browse the repository at this point in the history
  • Loading branch information
subru-37 committed Jan 15, 2025
1 parent 1c6418c commit 44d880d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions apps/web-admin/src/hooks/useFetch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const useFetch = () => {
const response = await axios.get(process.env.NEXT_PUBLIC_API_URL + endpoint, {
headers: {
...headers,
contentType: 'application/json',
'Content-Type': 'application/json',
Authorization:
'Bearer ' +
(await getAccessTokenSilently({
Expand Down Expand Up @@ -43,7 +43,7 @@ export const useFetch = () => {
const { data, status } = await axios.post(process.env.NEXT_PUBLIC_API_URL + endpoint, body, {
headers: {
...headers,
contentType: contentType,
'Content-Type': contentType,
Authorization:
'Bearer ' +
(await getAccessTokenSilently({
Expand Down Expand Up @@ -71,7 +71,7 @@ export const useFetch = () => {
const { data, status } = await axios.put(process.env.NEXT_PUBLIC_API_URL + endpoint, body, {
headers: {
...headers,
contentType: 'application/json',
'Content-Type': 'application/json',
Authorization:
'Bearer ' +
(await getAccessTokenSilently({
Expand Down Expand Up @@ -99,7 +99,7 @@ export const useFetch = () => {
const { data, status } = await axios.delete(process.env.NEXT_PUBLIC_API_URL + endpoint, {
headers: {
...headers,
contentType: 'application/json',
'Content-Type': 'application/json',
Authorization:
'Bearer ' +
(await getAccessTokenSilently({
Expand Down
8 changes: 4 additions & 4 deletions apps/web-admin/src/hooks/useRequests.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const useRequests = () => {
const response = await axios.get(process.env.NEXT_PUBLIC_API_URL + endpoint, {
headers: {
...headers,
contentType: 'application/json',
'Content-Type': 'application/json',
Authorization:
'Bearer ' +
(await getAccessTokenSilently({
Expand Down Expand Up @@ -47,7 +47,7 @@ export const useRequests = () => {
const { data, status } = await axios.post(process.env.NEXT_PUBLIC_API_URL + endpoint, body, {
headers: {
...headers,
contentType: contentType,
'Content-Type': contentType,
Authorization:
'Bearer ' +
(await getAccessTokenSilently({
Expand Down Expand Up @@ -79,7 +79,7 @@ export const useRequests = () => {
const { data, status } = await axios.put(process.env.NEXT_PUBLIC_API_URL + endpoint, body, {
headers: {
...headers,
contentType: 'application/json',
'Content-Type': 'application/json',
Authorization:
'Bearer ' +
(await getAccessTokenSilently({
Expand Down Expand Up @@ -110,7 +110,7 @@ export const useRequests = () => {
const { data, status } = await axios.delete(process.env.NEXT_PUBLIC_API_URL + endpoint, {
headers: {
...headers,
contentType: 'application/json',
'Content-Type': 'application/json',
Authorization:
'Bearer ' +
(await getAccessTokenSilently({
Expand Down

0 comments on commit 44d880d

Please sign in to comment.