Api.ts 368 B

1234567891011
  1. import Axios from 'axios';
  2. import { Fish, Insect } from 'types';
  3. export const getFishes = (): Promise<Fish[]> => Axios.get(`${process.env.REACT_APP_API}/fishes`).then(result => result.data);
  4. export const getInsects = (): Promise<Insect[]> => Axios.get(`${process.env.REACT_APP_API}/insects`).then(result => result.data);
  5. export default {
  6. getFishes,
  7. getInsects
  8. }