sort 관련 정리

This commit is contained in:
focp212@naver.com
2025-10-15 17:12:57 +09:00
parent 368b553bda
commit faccd7bd91
30 changed files with 439 additions and 258 deletions

View File

@@ -1,6 +1,6 @@
import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import { HeaderType, SortByKeys } from '@/entities/common/model/types';
import { HeaderType, SortTypeKeys } from '@/entities/common/model/types';
import { IMAGE_ROOT } from '@/shared/constants/common';
import {
useSetHeaderTitle,
@@ -32,7 +32,7 @@ export const AlimtalkListPage = () => {
const { navigate } = useNavigate();
const userMid = useStore.getState().UserStore.mid;
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
const [listItems, setListItems] = useState<Record<string, Array<AlimtalkListContent>>>({});
const [filterOn, setFilterOn] = useState<boolean>(false);
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
@@ -57,10 +57,10 @@ export const AlimtalkListPage = () => {
});
const callList = (option?: {
sortBy?: string,
sortType?: SortTypeKeys,
val?: string
}) => {
pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
pageParam.sortType = (option?.sortType)? option.sortType: sortType;
setPageParam(pageParam);
let params: ExtensionAlimtalkListParams = {