Sign in
bazel
/
continuous-integration
/
de5ab841b71c3b36cbd61912774c6afad3845793
/
.
/
dashboard
/
client
/
src
/
data
/
fetcher.ts
blob: 3205b223e8b15e57e9fc5726258db9c524ec093e [
file
] [
log
] [
blame
]
export
default
function
fetcher
(
input
:
RequestInfo
,
init
?:
RequestInit
)
{
return
fetch
(
input
,
init
).
then
((
res
)
=>
{
if
(
res
.
ok
)
{
return
res
.
json
();
}
return
res
.
json
().
then
((
error
)
=>
{
throw
error
;
});
});
}