We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a134c9 commit e2140faCopy full SHA for e2140fa
src/libs/fetch.js
@@ -1,5 +1,17 @@
1
// @todo Add error handling - Ryan
2
export default async function fetcher(...args) {
3
- const res = await fetch(...args)
+ const [url, options] = args
4
+
5
+ const fetchOptions = {
6
+ credentials: 'include',
7
+ headers: {
8
+ 'Content-Type': 'application/json',
9
+ },
10
+ mode: 'no-cors',
11
+ ...options,
12
+ }
13
14
+ const res = await fetch(url, fetchOptions)
15
16
return res.json()
17
}
0 commit comments