Skip to content
Merged
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
5 changes: 2 additions & 3 deletions src/features/accountbook/setting/service/exportExcel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import supabase from '@/supabase/supabase'

// 엑셀 데이터 불러오기
export async function getExcelData({
groupId,
startDate,
Expand All @@ -24,8 +23,8 @@ export async function getExcelData({
`
)
.eq('group_id', groupId)
.gte('created_at', startDate)
.lt('created_at', endDate)
.gte('date', startDate) // created_at → date로 변경
.lte('date', endDate) // lt → lte로 변경 (마지막 날도 포함)

if (error) throw error
return data
Expand Down
12 changes: 8 additions & 4 deletions src/pages/calendar/ui/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { useEffect, useState } from 'react'
import { useLoaderData, useNavigate, useParams } from 'react-router'
import {
useLoaderData,
useNavigate,
useParams,
useRevalidator
} from 'react-router'

import dayjs from 'dayjs'
import { useShallow } from 'zustand/shallow'
Expand Down Expand Up @@ -34,7 +39,7 @@ export const CalendarPage = () => {
const [calendarEventsByDate, setCalendarEventsByDate] = useState<
AccountItem[]
>([])

const revalidator = useRevalidator()
const { initialDate, events } = useLoaderData() as LoaderData
const { groupId } = useParams()

Expand Down Expand Up @@ -86,8 +91,7 @@ export const CalendarPage = () => {

if (toCreate.length) {
await createRecurringItem(toCreate)
// 새로운 항목이 생성되었으면 페이지 새로고침
window.location.reload()
revalidator.revalidate()
}
}
run()
Expand Down
Loading