reiji-h 2 лет назад
Родитель
Сommit
1ef47977d5

+ 1 - 1
apps/app/src/components/PageEditor/PageEditor.tsx

@@ -324,7 +324,7 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
           formData.append('page_id', pageId);
           formData.append('page_id', pageId);
         }
         }
 
 
-        const { data: resAdd } = await apiv3PostForm('/attachment/add', formData);
+        const { data: resAdd } = await apiv3PostForm('/attachment', formData);
 
 
         const attachment = resAdd.attachment;
         const attachment = resAdd.attachment;
         const fileName = attachment.originalName;
         const fileName = attachment.originalName;

+ 4 - 4
apps/app/src/server/routes/apiv3/attachment.js

@@ -230,11 +230,11 @@ module.exports = (crowi) => {
   /**
   /**
    * @swagger
    * @swagger
    *
    *
-   *    /attachment/add:
+   *    /attachment:
    *      post:
    *      post:
    *        tags: [Attachment, CrowiCompatibles]
    *        tags: [Attachment, CrowiCompatibles]
    *        operationId: addAttachment
    *        operationId: addAttachment
-   *        summary: /attachment/add
+   *        summary: /attachment
    *        description: Add attachment to the page
    *        description: Add attachment to the page
    *        requestBody:
    *        requestBody:
    *          content:
    *          content:
@@ -293,7 +293,7 @@ module.exports = (crowi) => {
    *            $ref: '#/components/responses/500'
    *            $ref: '#/components/responses/500'
    */
    */
   /**
   /**
-   * @api {post} /attachment/add Add attachment to the page
+   * @api {post} /attachment Add attachment to the page
    * @apiName AddAttachment
    * @apiName AddAttachment
    * @apiGroup Attachment
    * @apiGroup Attachment
    *
    *
@@ -301,7 +301,7 @@ module.exports = (crowi) => {
    * @apiParam {String} path
    * @apiParam {String} path
    * @apiParam {File} file
    * @apiParam {File} file
    */
    */
-  router.post('/add', uploads.single('file'), autoReap, accessTokenParser, loginRequiredStrictly, excludeReadOnlyUser,
+  router.post('/', uploads.single('file'), autoReap, accessTokenParser, loginRequiredStrictly, excludeReadOnlyUser,
     validator.retrieveAddAttachment, apiV3FormValidator, addActivity,
     validator.retrieveAddAttachment, apiV3FormValidator, addActivity,
     async(req, res) => {
     async(req, res) => {