Podpora mock dat pro vývoj o víkendech

This commit is contained in:
2023-06-03 09:24:36 +02:00
parent b438d2112a
commit c814624dbc
10 changed files with 58 additions and 17 deletions

View File

@@ -110,7 +110,7 @@ export const fetchPizzy = async () => {
// TODO tohle sem absolutně nepatří! dát do vlastní servisky!
export const fetchFood = async () => {
try {
const json = await rp(foodUrl);
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);