Enforce monthly budget updates

The budget update logic was modified to ensure that all budget updates are applied to the monthly budget, regardless of the selected tab. This resolves inconsistencies in budget calculations and data storage.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-22 11:27:35 +00:00
parent 13351fd613
commit 4f552632b7
5 changed files with 49 additions and 28 deletions

View File

@@ -17,12 +17,15 @@ export const useExtendedBudgetUpdate = (
) => {
console.log('확장 예산 업데이트 시작:', type, amount, newCategoryBudgets);
// 무조건 monthly로 설정 - 이게 핵심 수정 부분
const budgetType = 'monthly';
// 주간 예산인 경우 월간 예산으로 변환 (주간 값이 그대로 월간 값으로 설정되도록)
if (type === 'weekly') {
console.log(`주간 예산(${amount})을 월간 예산으로 직접 변환`);
type = 'monthly';
}
// 이제 항상 월간 예산으로 업데이트
console.log(`예산 업데이트: 타입을 '${budgetType}'로 강제 변환, 금액=${amount}`);
handleBudgetUpdate(budgetType, amount);
// 예산 업데이트
console.log(`예산 업데이트: 타입=${type}, 금액=${amount}`);
handleBudgetUpdate(type, amount);
// 카테고리 예산 업데이트 (제공된 경우)
if (newCategoryBudgets) {