Skip to content

Commit a04c98a

Browse files
committed
fix: fix few any implicit
1 parent 4a8012b commit a04c98a

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

packages/frontend/src/app/(admin-end)/dashboard/chat/page.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ export default function AdminChatPage() {
1616

1717
const pager = usePager({});
1818

19-
const { data, isLoading } = useSWR<IPagination<DashboardChatSession>>(
20-
`/dashboard/chat/sessions?page=${pager.page}&limit=${pager.limit}`,
21-
(key: string) => fetcher(key).then((res) => res.json()),
19+
const { data, isLoading } = useSWR<
20+
IPagination<DashboardChatSession>,
21+
any,
22+
string
23+
>(`/dashboard/chat/sessions?page=${pager.page}&limit=${pager.limit}`, (key) =>
24+
fetcher(key).then((res) => res.json()),
2225
);
2326

2427
if (isLoading) {

packages/frontend/src/app/(user-end)/premium/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default function PricingPage() {
7171
const { fetcher, setShowSideBar } = useStore();
7272
const [currentCategoryIndex, setCurrentCategoryIndex] = useState(0);
7373

74-
const { data: categories, isLoading } = useSWR<ICategory[]>(
74+
const { data: categories, isLoading } = useSWR<ICategory[], any, string>(
7575
'/product/all',
7676
(url) => fetcher(url).then((res) => res.json()),
7777
);

packages/frontend/src/components/chat/chat-list/index.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,22 @@ export function ChatItem(props: {
7878
export function ChatList() {
7979
const { fetcher, currentChatSessionId } = useStore();
8080

81-
const { data: sessions } = useSWR<ChatSession[]>('/chat/sessions', (url) => {
82-
return fetcher(url)
83-
.then((res) => res.json())
84-
.then((res) =>
85-
res.map((session: ChatSession & { _count: { messages: number } }) => ({
86-
...session,
87-
messagesCount: session._count.messages,
88-
_count: undefined,
89-
})),
90-
);
91-
});
81+
const { data: sessions } = useSWR<ChatSession[], any, string>(
82+
'/chat/sessions',
83+
(url) => {
84+
return fetcher(url)
85+
.then((res) => res.json())
86+
.then((res) =>
87+
res.map(
88+
(session: ChatSession & { _count: { messages: number } }) => ({
89+
...session,
90+
messagesCount: session._count.messages,
91+
_count: undefined,
92+
}),
93+
),
94+
);
95+
},
96+
);
9297

9398
return (
9499
<div className={styles['chat-list']}>

0 commit comments

Comments
 (0)