ChickenKyiv / ChickenKyiv/recipe-app-react-native

Helper file misteriously was clean up

Open
#169 0 comments 0 reactions 1 assignee Claimed by @atherdon View on GitHub
enhancement
Dominant language
JavaScript
Stars
22
Forks
17
PR merge metrics
No merged PRs in 30d

Description

# Description/Steps to reproduce
**UPD. at Expo we have a project with Helper file from groceristar-app**

ok, a bit info.
at October, 3 I create a task in order to move default functions that we have in our file:
`src/config/HelperFunctions.js` into our groceristar-fetch module. and i remember that file has a lot of data inside. Today we checked this file and didn't find that methods(not sure why).

difference can be seen here:
![screencapture-github-chickenkyiv-recipe-app-react-native-blob-master-src-config-helperfunctions-js-2018-10-16-02_21_18](https://user-images.githubusercontent.com/1469198/46983760-9ffeca00-d0ea-11e8-8572-a16688ebf019.png)
![screencapture-snack-expo-io-sofianed-recipe-app-2018-10-16-02_21_53](https://user-images.githubusercontent.com/1469198/46983761-9ffeca00-d0ea-11e8-949c-bf41da6c3d1c.png)

Code that is missing(yep, a bad way to manage changes, but fast):
```
import gf from '@groceristar/groceristar-fetch/groceristar';
import uuid from 'uuidv4';

const getOldGrocery = gf.getGrocery();
let newGrocery = getOldGrocery;

export const getAllDepartmentList = () => {
const newAllDepartments = gf.getAllDepartments();
const newAllDepartmentsObject = newAllDepartments.map(item => ({
key: uuid(),
departmentName: item,
}));

return newAllDepartmentsObject;
};

export const getAllIngredientsList = DeparmentName => {
const Ingredients = gf.getAllIngredientsByOneDepartment(`${DeparmentName}`);
const IngredientsObject = Ingredients.map(item => ({
key: uuid(),
IngredientName: item,
isChecked: false,
}));

return IngredientsObject;
};

export const getAllGrocery = () => {
const GroceryObjectArray = newGrocery.map(item => ({
key: uuid(),
IngredientName: item,
}));

return GroceryObjectArray;
};

export const getAllGroceryDepartment = departmentArray => {
const departmentArrayObject = departmentArray.map(item => ({
key: uuid(),
departmentName: item,
isChecked: false,
}));
return departmentArrayObject;
};

export const createNewGroceryList = newDepartment => {
const isAvailable = newGrocery.filter(item => {
if (item.name === newDepartment.name) {
return true;
}
return false;
});

if (isAvailable.length === 0) {
const newDepartmentList = [...newGrocery, newDepartment];
newGrocery = newDepartmentList;
}
};
```

# Expected result

# Additional information

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.