Refactor: Oddělení konektoru na parser menu

This commit is contained in:
2023-06-03 09:36:08 +02:00
parent c814624dbc
commit 19805713cd
3 changed files with 17 additions and 13 deletions

View File

@@ -105,15 +105,4 @@ export const fetchPizzy = async () => {
console.log(`Zapsán ${dataPath}`);
return pizzy;
}
}
// TODO tohle sem absolutně nepatří! dát do vlastní servisky!
export const fetchFood = async () => {
try {
const json = await rp({ uri: foodUrl, qs: { "mock": process.env.MOCK_DATA } });
return JSON.parse(json);
} catch (error) {
console.error("Chyba při volání Food API", error);
return {};
}
}