itizawa 5 lat temu
rodzic
commit
76ddd865a5

+ 4 - 3
src/client/js/components/Admin/Security/ShareLinkSetting.jsx

@@ -38,8 +38,8 @@ class ShareLinkSetting extends React.Component {
 
     try {
       const res = await appContainer.apiv3Delete('/share-links/all');
-      const count = res.data.n;
-      toastSuccess(t('toaster.remove_share_link', { count }));
+      const { deletedCount } = res.data;
+      toastSuccess(t('toaster.remove_share_link', { count: deletedCount }));
     }
     catch (err) {
       toastError(err);
@@ -58,7 +58,8 @@ class ShareLinkSetting extends React.Component {
             className="btn btn-danger pull-right"
             disabled={this.state.shareLinks.length === 0}
             onClick={this.showDeleteConfirmModal}
-          >Delete all links
+          >
+            Delete all links
           </button>
         </h2>
 

+ 2 - 1
src/server/routes/apiv3/share-links.js

@@ -164,7 +164,8 @@ module.exports = (crowi) => {
 
     try {
       const deletedShareLink = await ShareLink.deleteMany({});
-      return res.apiv3(deletedShareLink);
+      const { deletedCount } = deletedShareLink;
+      return res.apiv3({ deletedCount });
     }
     catch (err) {
       const msg = 'Error occurred in delete all share link';