// @flow import type { Quantity } from '../constants/QuantityConstants'; import { BASE_URL } from '../constants/AppConstants'; import type { QuantityResponse } from '../constants/QuantityConstants'; export const setQuantity = ({ foodItemId, quantity, }: { foodItemId: string, quantity: Quantity, }): ?Promise => { try { return fetch(`http://${BASE_URL}/quantity`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ foodItemId, quantity, }), }).then(res => res.json()); } catch (error) { console.log(error); //eslint-disable-line } };