This commit is contained in:
parent
99c95d0706
commit
fc3366d52a
@ -194,7 +194,7 @@ const LessonList = () => {
|
|||||||
const toastRef = useRef(null)
|
const toastRef = useRef(null)
|
||||||
const createdLessonRef = useRef(null)
|
const createdLessonRef = useRef(null)
|
||||||
const [editLesson, setEditLesson] = useState<Lesson>(null)
|
const [editLesson, setEditLesson] = useState<Lesson>(null)
|
||||||
const sorted = useMemo(() => [...(data?.body || [])]?.sort((a, b) => a.date < b.date ? 1 : -1), [data, data?.body])
|
const sorted = useMemo(() => [...(data?.body || [])]?.sort((a, b) => a.date > b.date ? 1 : -1), [data, data?.body])
|
||||||
|
|
||||||
const lessonCalc = useMemo(() => {
|
const lessonCalc = useMemo(() => {
|
||||||
if (!isSuccess) {
|
if (!isSuccess) {
|
||||||
@ -223,7 +223,7 @@ const LessonList = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return lessonsData
|
return lessonsData.sort((a, b) => a.date < b.date? 1 : -1)
|
||||||
}, [groupByDate, isSuccess, sorted])
|
}, [groupByDate, isSuccess, sorted])
|
||||||
|
|
||||||
const onSubmit = (lessonData) => {
|
const onSubmit = (lessonData) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user