made weekly goal daily value but multiplied by 7 in the post - just much more intuitve

This commit is contained in:
Ava DeCroix
2023-05-04 18:18:15 -04:00
parent 2c05005ca0
commit 264d3ff80b
5 changed files with 17 additions and 13 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -41,6 +41,10 @@ export function Login() {
navigate('/Plan'); navigate('/Plan');
} }
const navigateProg = () => {
navigate('/ThisWeek');
}
//State variable for login data //State variable for login data
const [data,setData] = useState({ const [data,setData] = useState({
net_id:"", net_id:"",
@@ -74,7 +78,7 @@ export function Login() {
console.log(response.status); console.log(response.status);
if (response.status === 200){ if (response.status === 200){
setSession(); setSession();
navigateHome(); navigateProg();
} }
}); });

View File

@@ -125,17 +125,17 @@ const submitGoalHandler = evt => {
{ {
net_id: net_id, net_id: net_id,
week_date: weekStart(), week_date: weekStart(),
total_cal: Number(total_cal[0]), total_cal: Number(total_cal[0])*7,
total_fat: Number(total_fat[0]), total_fat: Number(total_fat[0])*7,
total_sat_fat: Number(total_sat_fat[0]), total_sat_fat: Number(total_sat_fat[0])*7,
total_trans_fat: Number(total_trans_fat[0]), total_trans_fat: Number(total_trans_fat[0])*7,
total_carbs: Number(total_carbs[0]), total_carbs: Number(total_carbs[0])*7,
total_fiber: Number(total_fiber[0]), total_fiber: Number(total_fiber[0])*7,
total_sugar: Number(total_sugar[0]), total_sugar: Number(total_sugar[0])*7,
total_protein: Number(total_protein[0]), total_protein: Number(total_protein[0])*7,
total_sodium: Number(total_sodium[0]), total_sodium: Number(total_sodium[0])*7,
total_potassium: Number(total_potassium[0]), total_potassium: Number(total_potassium[0])*7,
total_cholesterol: Number(total_cholesterol[0]) total_cholesterol: Number(total_cholesterol[0])*7
}).then((response) => { }).then((response) => {
console.log(response); console.log(response);
console.log(response.status); console.log(response.status);

View File

@@ -142,7 +142,7 @@ const net_id = ReactSession.get("net_id");
} }
const [toDelete, setToDelete] = useState([]); const [toDelete, setToDelete] = useState([{}]);
const removeItem = (index) => { const removeItem = (index) => {
setToDelete([ setToDelete([