Shun Miyazawa 1 год назад
Родитель
Сommit
b0db9da546
1 измененных файлов с 3 добавлено и 9 удалено
  1. 3 9
      apps/app/src/server/routes/apiv3/page/index.ts

+ 3 - 9
apps/app/src/server/routes/apiv3/page/index.ts

@@ -1,5 +1,6 @@
 import path from 'path';
 import path from 'path';
-import { pipeline, type Readable } from 'stream';
+import { type Readable } from 'stream';
+import { pipeline } from 'stream/promises';
 
 
 import type { IPage } from '@growi/core';
 import type { IPage } from '@growi/core';
 import {
 import {
@@ -761,14 +762,7 @@ module.exports = (crowi) => {
     };
     };
     await crowi.activityService.createActivity(parameters);
     await crowi.activityService.createActivity(parameters);
 
 
-    // The last stream in the pipeline must be a function
-    // https://stackoverflow.com/questions/75118262/gulp-generates-typeerror-the-streams-property-must-be-of-type-function
-    return pipeline(stream, res, (err) => {
-      if (err) {
-        logger.error('Failed to export page', err);
-        return res.apiv3Err(err, 500);
-      }
-    });
+    await pipeline(stream, res);
   });
   });
 
 
   /**
   /**