itizawa 6 лет назад
Родитель
Сommit
f6485e23f0
1 измененных файлов с 36 добавлено и 61 удалено
  1. 36 61
      src/server/routes/apiv3/customize-setting.js

+ 36 - 61
src/server/routes/apiv3/customize-setting.js

@@ -163,21 +163,16 @@ module.exports = (crowi) => {
    *              schama:
    *                type: object
    *                properties:
-   *                  layoutType:
-   *                    description: type of layout
-   *                    type: string
-   *                  themeType:
-   *                    description: type of theme
-   *                    type: string
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeLayoutTheme'
    *      responses:
    *        200:
    *          description: Succeeded to update layout and theme
    *          content:
    *            application/json:
    *              schema:
+   *                type: object
    *                properties:
-   *                  customizedParams:
-   *                    $ref: '#/components/schemas/CustomizeParams/CustomizeLayoutTheme'
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeLayoutTheme'
    */
   router.put('/layoutTheme', loginRequiredStrictly, adminRequired, csrf, validator.layoutTheme, ApiV3FormValidator, async(req, res) => {
     const requestParams = {
@@ -214,18 +209,16 @@ module.exports = (crowi) => {
    *              schama:
    *                type: object
    *                properties:
-   *                  behaviorType:
-   *                    description: type of behavior
-   *                    type: string
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeBehavior'
    *      responses:
    *        200:
    *          description: Succeeded to update behavior
    *          content:
    *            application/json:
    *              schema:
+   *                type: object
    *                properties:
-   *                  customizedParams:
-   *                    $ref: '#/components/schemas/CustomizeParams/CustomizeBehavior'
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeBehavior'
    */
   router.put('/behavior', loginRequiredStrictly, adminRequired, csrf, validator.behavior, ApiV3FormValidator, async(req, res) => {
     const requestParams = {
@@ -260,27 +253,16 @@ module.exports = (crowi) => {
    *              schama:
    *                type: object
    *                properties:
-   *                  isEnabledTimeline:
-   *                    description: is enabled timeline
-   *                    type: boolean
-   *                  isSavedStatesOfTabChanges:
-   *                    description: is saved states of tabChanges
-   *                    type: boolean
-   *                  isEnabledAttachTitleHeader:
-   *                    description: is enabled attach titleHeader
-   *                    type: boolean
-   *                  recentCreatedLimit:
-   *                    description: limit of recent created
-   *                    type: number
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeFunction'
    *      responses:
    *        200:
    *          description: Succeeded to update function
    *          content:
    *            application/json:
    *              schema:
+   *                type: object
    *                properties:
-   *                  customizedParams:
-   *                    $ref: '#/components/schemas/CustomizeParams/CustomizeFunction'
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeFunction'
    */
   router.put('/function', loginRequiredStrictly, adminRequired, csrf, validator.function, ApiV3FormValidator, async(req, res) => {
     const requestParams = {
@@ -321,21 +303,16 @@ module.exports = (crowi) => {
    *              schama:
    *                type: object
    *                properties:
-   *                  highlightJsStyle:
-   *                    description: style name of highlight
-   *                    type: string
-   *                  highlightJsStyleBorder:
-   *                    description: enable border of highlight
-   *                    type: boolean
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeHighlight'
    *      responses:
-   *          200:
-   *            description: Succeeded to update highlight
-   *            content:
-   *              application/json:
-   *                schema:
-   *                  properties:
-   *                    customizedParams:
-   *                      $ref: '#/components/schemas/CustomizeParams/CustomizeHighlight'
+   *        200:
+   *          description: Succeeded to update highlight
+   *          content:
+   *            application/json:
+   *              schema:
+   *                type: object
+   *                properties:
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeHighlight'
    */
   router.put('/highlight', loginRequiredStrictly, adminRequired, csrf, validator.highlight, ApiV3FormValidator, async(req, res) => {
     const requestParams = {
@@ -372,12 +349,16 @@ module.exports = (crowi) => {
    *              schema:
    *                type: object
    *                properties:
-   *                  title:
-   *                    description: customized title
-   *                    type: string
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeTitle'
    *      responses:
-   *          200:
-   *            description: Succeeded to update customizeTitle
+   *        200:
+   *          description: Succeeded to update customizeTitle
+   *          content:
+   *            application/json:
+   *              schema:
+   *                type: object
+   *                properties:
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeTitle'
    */
   router.put('/customize-title', loginRequiredStrictly, adminRequired, csrf, validator.customizeTitle, ApiV3FormValidator, async(req, res) => {
     const requestParams = {
@@ -413,18 +394,16 @@ module.exports = (crowi) => {
    *              schama:
    *                type: object
    *                properties:
-   *                  customizeHeader:
-   *                    description: customize header
-   *                    type: string
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeHeader'
    *      responses:
    *        200:
    *          description: Succeeded to update customize header
    *          content:
    *            application/json:
    *              schema:
+   *                type: object
    *                properties:
-   *                  customizedParams:
-   *                    $ref: '#/components/schemas/CustomizeParams/CustomizeHeader'
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeHeader'
    */
   router.put('/customize-header', loginRequiredStrictly, adminRequired, csrf, validator.customizeHeader, ApiV3FormValidator, async(req, res) => {
     const requestParams = {
@@ -458,18 +437,16 @@ module.exports = (crowi) => {
    *              schama:
    *                type: object
    *                properties:
-   *                  customizeCss:
-   *                    description: customize css
-   *                    type: string
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeCss'
    *      responses:
    *        200:
    *          description: Succeeded to update customize css
    *          content:
    *            application/json:
    *              schema:
+   *                type: object
    *                properties:
-   *                  customizedParams:
-   *                    $ref: '#/components/schemas/CustomizeParams/CustomizeCss'
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeCss'
    */
   router.put('/customize-css', loginRequiredStrictly, adminRequired, csrf, validator.customizeCss, ApiV3FormValidator, async(req, res) => {
     const requestParams = {
@@ -504,18 +481,16 @@ module.exports = (crowi) => {
    *              schama:
    *                type: object
    *                properties:
-   *                  customizeScript:
-   *                    description: customize script
-   *                    type: string
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeScript'
    *      responses:
    *        200:
    *          description: Succeeded to update customize script
    *          content:
    *            application/json:
    *              schema:
+   *                type: object
    *                properties:
-   *                  customizedParams:
-   *                    $ref: '#/components/schemas/CustomizeParams/CustomizeScript'
+   *                  $ref: '#/components/schemas/CustomizeParams/CustomizeScript'
    */
   router.put('/customize-script', loginRequiredStrictly, adminRequired, csrf, validator.customizeScript, ApiV3FormValidator, async(req, res) => {
     const requestParams = {