arvid-e 7 месяцев назад
Родитель
Сommit
debf24f3bc
1 измененных файлов с 0 добавлено и 84 удалено
  1. 0 84
      apps/app/src/server/routes/apiv3/content-disposition-settings.ts

+ 0 - 84
apps/app/src/server/routes/apiv3/content-disposition-settings.ts

@@ -309,89 +309,5 @@ module.exports = (crowi) => {
     },
   );
 
-
-  /**
- * @swagger
- *
- * paths:
- *    /content-disposition-settings/{mimeType}:
- *      put:
- *        tags: [Content Disposition Settings]
- *        summary: Update content disposition setting for a specific MIME type
- *        security:
- *          - cookieAuth: []
- *        parameters:
- *          - $ref: '#/components/parameters/MimeTypePathParam'
- *        requestBody:
- *          required: true
- *          content:
- *            application/json:
- *              schema:
- *                type: object
- *                required:
- *                  - disposition
- *                properties:
- *                  disposition:
- *                     type: string
- *        responses:
- *          200:
- *            description: Successfully updated content disposition setting
- *            content:
- *              application/json:
- *                schema:
- *                  type: object
- *                  properties:
- *                    setting:
- *                       type: object
- *                       properties:
- *                         mimeType:
- *                           type: string
- *                         disposition:
- *                           type: string
- */
-  router.put(
-    '/:mimeType(*)',
-    loginRequiredStrictly,
-    adminRequired,
-    addActivity,
-    validator.updateContentDisposition,
-    apiV3FormValidator,
-    async(req, res) => {
-      const { mimeType } = req.params;
-      const { disposition } = req.body;
-
-      try {
-        const currentMimeTypeDefaults = configManager.getConfig('attachments:contentDisposition:mimeTypeOverrides');
-
-        const newDisposition: 'inline' | 'attachment' = disposition;
-
-        const updatedMimeTypeDefaults = {
-          ...currentMimeTypeDefaults,
-          [mimeType]: newDisposition,
-        };
-
-        await configManager.updateConfigs({ 'attachments:contentDisposition:mimeTypeOverrides': updatedMimeTypeDefaults });
-        const updatedDispositionFromDb = configManager.getConfig('attachments:contentDisposition:mimeTypeOverrides')[mimeType];
-
-        const parameters = {
-          action: SupportedAction.ACTION_ADMIN_ATTACHMENT_DISPOSITION_UPDATE,
-          mimeType,
-          disposition: updatedDispositionFromDb,
-        };
-        activityEvent.emit('update', res.locals.activity._id, parameters);
-
-        return res.apiv3({ mimeType, disposition: updatedDispositionFromDb });
-      }
-      catch (err) {
-        const msg = `Error occurred in updating content disposition for MIME type: ${mimeType}`;
-        logger.error(msg, err);
-        return res.apiv3Err(
-          new ErrorV3(msg, 'update-content-disposition-failed'),
-        );
-      }
-    },
-  );
-
-
   return router;
 };