services.ts 309 B

12345678910111213
  1. import axios, { AxiosPromise } from 'axios';
  2. import IRecipe from 'types/recipes';
  3. //@ts-ignore
  4. const API: string = process.env.REACT_APP_API_RECIPES;
  5. export const getRecipes = (query: any): Promise<IRecipe[]> =>
  6. axios.get(`${API}all`)
  7. .then(response => response.data);
  8. export default {
  9. getRecipes,
  10. }