[as] chore: 알림이력 notiUrl 리졸버 추가
This commit is contained in:
@@ -44,10 +44,25 @@ function NtiHstryList({ searchParams, pagination, onPaginationChange }: NtiHstry
|
||||
|
||||
const pageQuery = useFindMyAsNotiList(queryParams);
|
||||
|
||||
const resolveNotiUrl = (row: NotiAsUserResponseDto) => {
|
||||
const notiUrl = row.notiUrl?.trim();
|
||||
if (!notiUrl) return null;
|
||||
|
||||
if (row.docSeComCd === "SEWER") {
|
||||
const parts = notiUrl.split("/");
|
||||
if (parts.length > 1) {
|
||||
parts.pop();
|
||||
return parts.join("/");
|
||||
}
|
||||
}
|
||||
|
||||
return notiUrl;
|
||||
};
|
||||
|
||||
const handleAction = useCallback(
|
||||
async (row: NotiAsUserResponseDto) => {
|
||||
await readNoti(row.notiId);
|
||||
const notiUrl = row.notiUrl?.trim();
|
||||
const notiUrl = resolveNotiUrl(row);
|
||||
if (!notiUrl) return;
|
||||
router.push(notiUrl);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user