|
@@ -3,9 +3,11 @@ import useSWR, { SWRResponse } from 'swr';
|
|
|
import { Types } from 'mongoose';
|
|
import { Types } from 'mongoose';
|
|
|
import { apiv3Get } from '~/client/util/apiv3-client';
|
|
import { apiv3Get } from '~/client/util/apiv3-client';
|
|
|
|
|
|
|
|
|
|
+import { IBookmarksInfo } from '~/interfaces/bookmarks';
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
-export const useSWRxBookmarksInfo = <Data, Error>(pageId: Types.ObjectId):SWRResponse<{isBookmarked: boolean | null, sumOfBookmarks: number | null}, Error> => {
|
|
|
|
|
|
|
+export const useSWRxBookmarksInfo = <Data, Error>(pageId: Types.ObjectId):SWRResponse<IBookmarksInfo, Error> => {
|
|
|
return useSWR(
|
|
return useSWR(
|
|
|
['/bookmarks/info', pageId],
|
|
['/bookmarks/info', pageId],
|
|
|
(endpoint, pageId) => apiv3Get(endpoint, { pageId }).then((response) => {
|
|
(endpoint, pageId) => apiv3Get(endpoint, { pageId }).then((response) => {
|