itizawa 6 лет назад
Родитель
Сommit
8fd4684de3

+ 2 - 2
src/client/js/services/AdminCustomizeContainer.js

@@ -54,8 +54,8 @@ export default class AdminCustomizeContainer extends Container {
       layoutType: this.state.currentLayout,
       themeType: this.state.currentTheme,
     });
-    const { customizeParams } = response.data;
-    return customizeParams;
+    const { customizedParams } = response.data;
+    return customizedParams;
   }
 
 }

+ 7 - 3
src/server/routes/apiv3/customize-setting.js

@@ -55,14 +55,18 @@ module.exports = (crowi) => {
    *            description: Succeeded to update layout and theme
    */
   router.put('/layoutTheme', loginRequiredStrictly, adminRequired, csrf, validator.layoutTheme, ApiV3FormValidator, async(req, res) => {
-    const customizeParams = {
+    const requestParams = {
       'customize:layout': req.body.layoutType,
       'customize:theme': req.body.themeType,
     };
 
     try {
-      await crowi.configManager.updateConfigsInTheSameNamespace('crowi', customizeParams);
-      return res.apiv3({ customizeParams });
+      await crowi.configManager.updateConfigsInTheSameNamespace('crowi', requestParams);
+      const customizedParams = {
+        layoutType: await crowi.configManager.getConfig('crowi', 'customize:layout'),
+        themeType: await crowi.configManager.getConfig('crowi', 'customize:theme'),
+      };
+      return res.apiv3({ customizedParams });
     }
     catch (err) {
       const msg = 'Error occurred in updating layout and theme';