aretherecookies-mobile/js/constants/QuantityConstants.js
Bart Akeley 9221b7f9b5 quantities round trip api and stream
make POST requests to /quantity to update the quantity of an existing food item - then mixin the new quantity with the existing food items observable
2017-11-26 19:52:16 -06:00

17 lines
561 B
JavaScript

// @flow
export const QUANTITY_NONE: 'none' = 'none';
export const QUANTITY_FEW: 'few' = 'few';
export const QUANTITY_MANY: 'many' = 'many';
export const QUANTITY_LOTS: 'lots' = 'lots';
export const QUANTITIES = [QUANTITY_NONE, QUANTITY_FEW, QUANTITY_LOTS, QUANTITY_MANY];
export type Quantity = typeof QUANTITY_NONE | typeof QUANTITY_FEW | typeof QUANTITY_MANY | typeof QUANTITY_LOTS;
export type QuantityResponse = {
food_item_id: string,
quantity: Quantity,
date: number,
};
export type QuantityFragment = { quantity: Quantity, lastupdated: number };