|
|
@@ -26,25 +26,14 @@ const PageShareManagement = (props) => {
|
|
|
setIsOutsideShareLinkModalShown(false);
|
|
|
}
|
|
|
|
|
|
- async function exportPageHundler(type) {
|
|
|
+ async function exportPageHundler() {
|
|
|
const { pageId, revisionId } = pageContainer.state;
|
|
|
try {
|
|
|
- const axios = require('axios').create({
|
|
|
- responseType: 'arraybuffer',
|
|
|
- });
|
|
|
-
|
|
|
- const { data } = await axios.get('/_api/v3/page/export', {
|
|
|
- params:
|
|
|
- {
|
|
|
- pageId,
|
|
|
- revisionId,
|
|
|
- type,
|
|
|
- },
|
|
|
- });
|
|
|
- const blob = new Blob([data]);
|
|
|
+ const { data } = await appContainer.apiv3Get('/page/export', { pageId, revisionId });
|
|
|
+ const blob = new Blob([data.markdown]);
|
|
|
const link = document.createElement('a');
|
|
|
link.href = window.URL.createObjectURL(blob);
|
|
|
- link.download = `${revisionId}.${type}`;
|
|
|
+ link.download = `${revisionId}.md`;
|
|
|
link.click();
|
|
|
link.remove();
|
|
|
}
|
|
|
@@ -68,7 +57,6 @@ const PageShareManagement = (props) => {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
function renderCurrentUser() {
|
|
|
return (
|
|
|
<>
|
|
|
@@ -108,12 +96,9 @@ const PageShareManagement = (props) => {
|
|
|
<i className="icon-fw icon-link"></i>{t('share_links.Shere this page link to public')}
|
|
|
<span className="ml-2 badge badge-info badge-pill">{pageContainer.state.shareLinksNumber}</span>
|
|
|
</button>
|
|
|
- <button type="button" className="dropdown-item" onClick={() => { exportPageHundler('md') }}>
|
|
|
+ <button type="button" className="dropdown-item" onClick={() => { exportPageHundler() }}>
|
|
|
<span>{t('export_bulk.export_page_markdown')}</span>
|
|
|
</button>
|
|
|
- <button type="button" className="dropdown-item" onClick={() => { exportPageHundler('pdf') }}>
|
|
|
- <span>{t('export_bulk.export_page_pdf')}</span>
|
|
|
- </button>
|
|
|
</div>
|
|
|
{renderModals()}
|
|
|
</>
|