Просмотр исходного кода

Update bookmark folder api and import new toaster

https://youtrack.weseek.co.jp/issue/GW-7910
- Remove question mark from bookmarkFolders
- Import new toaster module in Bookmark component
- Remove unused useTranslation
Mudana-Grune 3 лет назад
Родитель
Сommit
3792448171

+ 0 - 3
packages/app/src/components/Bookmarks/BookmarkFolderTree.tsx

@@ -1,6 +1,4 @@
 
-import { useTranslation } from 'next-i18next';
-
 import { useSWRxBookamrkFolderAndChild } from '~/stores/bookmark-folder';
 
 import BookmarkFolderItem from './BookmarkFolderItem';
@@ -9,7 +7,6 @@ import styles from './BookmarkFolderTree.module.scss';
 
 
 const BookmarkFolderTree = (): JSX.Element => {
-  const { t } = useTranslation();
   const { data: bookmarkFolderData } = useSWRxBookamrkFolderAndChild();
 
   return (

+ 1 - 1
packages/app/src/components/Bookmarks/BookmarkItem.tsx

@@ -7,8 +7,8 @@ import { useTranslation } from 'react-i18next';
 import { UncontrolledTooltip, DropdownToggle } from 'reactstrap';
 
 import { unbookmark } from '~/client/services/page-operation';
-import { toastError, toastSuccess } from '~/client/util/apiNotification';
 import { apiv3Put } from '~/client/util/apiv3-client';
+import { toastError, toastSuccess } from '~/client/util/toastr';
 import { IPageHasId, IPageInfoAll, IPageToDeleteWithMeta } from '~/interfaces/page';
 
 

+ 1 - 1
packages/app/src/components/Bookmarks/BookmarkItemList.tsx

@@ -2,7 +2,7 @@ import React, { useCallback } from 'react';
 
 import { useTranslation } from 'next-i18next';
 
-import { toastSuccess } from '~/client/util/apiNotification';
+import { toastSuccess } from '~/client/util/toastr';
 import { IPageToDeleteWithMeta } from '~/interfaces/page';
 import { OnDeletedFunction } from '~/interfaces/ui';
 import { useSWRxCurrentUserBookmarks } from '~/stores/bookmark';

+ 1 - 1
packages/app/src/server/routes/apiv3/bookmark-folder.ts

@@ -55,7 +55,7 @@ module.exports = (crowi) => {
     const _parentId = parentId ?? null;
     try {
       const bookmarkFolders = await BookmarkFolder.findFolderAndChildren(req.user?._id, _parentId);
-      const bookmarkFolderItems = bookmarkFolders?.map(bookmarkFolder => ({
+      const bookmarkFolderItems = bookmarkFolders.map(bookmarkFolder => ({
         _id: bookmarkFolder._id,
         name: bookmarkFolder.name,
         parent: bookmarkFolder.parent,