Skip to content

Commit

Permalink
fix: 회비 수정 시 postDues 대신 putDues 만 사용 가능 하기 때문에 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dooohun committed Feb 2, 2025
1 parent a25a546 commit 685070c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/page/DuesSetup/hooks/useApplyParsedData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DuesInfo } from 'model/dues/allDues';
import { useGetAllDues, usePostDues } from 'query/dues';
import { useGetAllDues, usePostDues, usePutDues } from 'query/dues';
import { useGetMembers } from 'query/members';

interface ParseExcelData {
Expand Down Expand Up @@ -79,6 +79,7 @@ export function useApplyParsedData() {
const { data: currentYearDues } = useGetAllDues({ year: currentYear });
const { data: members } = useGetMembers({ pageIndex: 0, pageSize: 1000, trackId: null });
const duesMutation = usePostDues();
const duesChangeMutation = usePutDues();

const applyFeeStatus = (parseExcelData: ParseExcelData[]) => {
const parseExcelDataWithUnpaidMonth = findUnpaidMonth({ prevYearDues, currentYearDues, parseExcelData });
Expand All @@ -89,7 +90,7 @@ export function useApplyParsedData() {
Array.from({ length: member.duesCount }).forEach((_, index) => {
const month = ((member.unpaidMonth - 1 + index) % 12) + 1;
const year = member.unpaidMonth + index >= 12 ? member.unpaidYear + 1 : member.unpaidYear;
duesMutation.mutate({
duesChangeMutation.mutate({
memberId: member.memberId,
year,
month,
Expand Down

0 comments on commit 685070c

Please sign in to comment.