Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions client/src/components/expense/editExpense.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Loading from '../loading';
import { useNavigate } from "react-router-dom";
import AlertBanner from '../AlertBanner';
import { parseISO } from 'date-fns';

import configData from '../../config.json';


export default function EditExpense() {
Expand Down Expand Up @@ -55,7 +55,7 @@ export default function EditExpense() {
onSubmit: async () => {
setLoading(true)
if(await editExpenseService(values, setAlert, setAlertMessage))
navigate(-1)
window.location = configData.VIEW_GROUP_URL + values.groupId
},
});

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/groups/settlement/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const GroupSettlements = ({ currencyType }) => {
setLoading(false)
}
getGroupSettlement()
}, [reload])
}, [reload, params.groupId])

return (
<>
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/groups/viewGroup/groupCategoryGraph.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ const GroupCategoryGraph = ({currencyType}) => {
}
const category_exp =
await getGroupCategoryExpService(groupIdJson, setAlert, setAlertMessage)
setCategoryExp(category_exp.data.data)
setCategoryExp(category_exp?.data?.data)
setLoading(false)
}
getGroupCategoryExpense()

}, [])
}, [params.groupId])
return (
<>
{loading ? <Loading /> :
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/groups/viewGroup/groupMonthlyGraph.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ const GroupMonthlyGraph = () => {
const monthly_exp =
await getGroupMonthlyExpService(groupIdJson, setAlert, setAlertMessage)
const daily_exp = await getGroupDailyExpService(groupIdJson, setAlert, setAlertMessage)
setMonthlyExp(monthly_exp.data.data)
setDailyExp(daily_exp.data.data)
setMonthlyExp(monthly_exp?.data?.data)
setDailyExp(daily_exp?.data?.data)
setLoading(false)
}
getGroupMonthlyExpense()

}, [])
}, [params.groupId])
return (
<>
{loading ? <Loading /> :
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/groups/viewGroup/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function ViewGroup() {
setLoading(false)
}
getGroupDetails()
}, []);
}, [params.groupId]);

const CategoryStyle = styled('span')(({ theme }) => ({
top: 22,
Expand Down
8 changes: 4 additions & 4 deletions components/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ exports.addSplit = async (groupId, expenseAmount, expenseOwner, expenseMembers)
})
group.groupTotal += expenseAmount
group.split[0][expenseOwner] += expenseAmount
expensePerPerson = expenseAmount / expenseMembers.length
let expensePerPerson = expenseAmount / expenseMembers.length
expensePerPerson = Math.round((expensePerPerson + Number.EPSILON) * 100) / 100;
//Updating the split values per user
for (var user of expenseMembers) {
Expand All @@ -310,7 +310,7 @@ exports.addSplit = async (groupId, expenseAmount, expenseOwner, expenseMembers)

//Nullifying split - check if the group balance is zero else added the diff to owner
let bal=0
for(val of Object.entries(group.split[0]))
for(let val of Object.entries(group.split[0]))
{
bal += val[1]
}
Expand All @@ -334,7 +334,7 @@ exports.clearSplit = async (groupId, expenseAmount, expenseOwner, expenseMembers
})
group.groupTotal -= expenseAmount
group.split[0][expenseOwner] -= expenseAmount
expensePerPerson = expenseAmount / expenseMembers.length
let expensePerPerson = expenseAmount / expenseMembers.length
expensePerPerson = Math.round((expensePerPerson + Number.EPSILON) * 100) / 100;
//Updating the split values per user
for (var user of expenseMembers) {
Expand All @@ -343,7 +343,7 @@ exports.clearSplit = async (groupId, expenseAmount, expenseOwner, expenseMembers

//Nullifying split - check if the group balance is zero else added the diff to owner
let bal=0
for(val of Object.entries(group.split[0]))
for(let val of Object.entries(group.split[0]))
{
bal += val[1]
}
Expand Down