Cleaned up usage of fetch

This commit is contained in:
2022-06-10 16:53:42 +01:00
parent ed01fe6db5
commit 490860159e
6 changed files with 11 additions and 22 deletions
@@ -18,12 +18,7 @@ const NewsEditor = props => {
//run once
useEffect(async () => {
const result = await fetch(`${process.env.NEWS_URI}/news/metadata?limit=999`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
});
const result = await fetch(`${process.env.NEWS_URI}/news/metadata?limit=999`);
if (!result.ok) {
const err = `${result.status}: ${await result.text()}`;