2
0

bookmark-folder.ts 475 B

123456789101112131415
  1. import { SWRResponse } from 'swr';
  2. import useSWRImmutable from 'swr/immutable';
  3. import { apiv3Get } from '~/client/util/apiv3-client';
  4. import { BookmarkFolderItems } from '~/interfaces/bookmark-info';
  5. export const useSWRxBookmarkFolderAndChild = (): SWRResponse<BookmarkFolderItems[], Error> => {
  6. return useSWRImmutable(
  7. '/bookmark-folder/list',
  8. endpoint => apiv3Get(endpoint).then((response) => {
  9. return response.data.bookmarkFolderItems;
  10. }),
  11. );
  12. };