mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 06:04:55 -06:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
377a43af0c
4 changed files with 12 additions and 8 deletions
|
|
@ -92,7 +92,7 @@ android {
|
|||
applicationId "com.aretherecookies"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 60
|
||||
versionCode 61
|
||||
versionName "1.0"
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "x86"
|
||||
|
|
|
|||
|
|
@ -76,18 +76,18 @@ export const getFoodItems = memoize(
|
|||
);
|
||||
|
||||
export const createFoodItem = async (foodItem: FoodItemRecord) => {
|
||||
if (!AuthManager.user) {
|
||||
throw new Error('You must be logged in to create food items');
|
||||
}
|
||||
|
||||
const username = AuthManager.user.name;
|
||||
|
||||
const res = await fetchRequest({
|
||||
endpoint: '/addfooditem',
|
||||
method: 'POST',
|
||||
body: foodItem,
|
||||
});
|
||||
|
||||
if (!AuthManager.user) {
|
||||
return;
|
||||
}
|
||||
|
||||
const username = AuthManager.user.name;
|
||||
|
||||
const addImageUri = (imageUri: string) => addImage({ foodItemId: res.id, imageUri, username });
|
||||
|
||||
const images = map(path(['url']), await Promise.all(map(addImageUri, foodItem.images.toArray())));
|
||||
|
|
|
|||
|
|
@ -38,7 +38,10 @@ const FoodRecordDefaults: FoodItem = {
|
|||
const FoodItemRecord = Record(FoodRecordDefaults, 'FoodItemRecord');
|
||||
|
||||
export const createFoodItem = (foodItemRaw: ?RawFoodItem) => {
|
||||
return !foodItemRaw ? foodItemRaw : new FoodItemRecord({
|
||||
if (!foodItemRaw) {
|
||||
return foodItemRaw;
|
||||
}
|
||||
return new FoodItemRecord({
|
||||
...foodItemRaw,
|
||||
placeId: foodItemRaw.placeid,
|
||||
thumbImage: foodItemRaw.thumbimage,
|
||||
|
|
|
|||
|
|
@ -4964,6 +4964,7 @@ react-native-image-picker@^0.27:
|
|||
react-native-image-resizer@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-image-resizer/-/react-native-image-resizer-1.0.0.tgz#d47e14943c37938e287fbd639e4db7ceb7fd8917"
|
||||
integrity sha1-1H4UlDw3k44of71jnk23zrf9iRc=
|
||||
|
||||
react-native-loading-spinner-overlay@^0.5.2:
|
||||
version "0.5.2"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue