Skip to content

Commit

Permalink
fix(useSurrealFetch): header overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed May 28, 2024
1 parent bcb5b45 commit c3b4d37
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/runtime/composables/surreal-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ export function useSurrealFetch<T>(
if (token) {
headers.Authorization = token
}
opts.headers = Object.keys(headers).length
? {
...opts.headers,
...headers,
}
: undefined

return useFetch(endpoint, {
...opts,
headers: {
Accept: 'application/json',
...opts.headers,
...headers,
},
$fetch: useNuxtApp().$surrealFetch,
})
}

0 comments on commit c3b4d37

Please sign in to comment.