瀏覽代碼

fix: navigation mode change not persisted

NGPixel 5 年之前
父節點
當前提交
c15d1a4967
共有 1 個文件被更改,包括 12 次插入3 次删除
  1. 12 3
      client/components/admin/admin-navigation.vue

+ 12 - 3
client/components/admin/admin-navigation.vue

@@ -376,7 +376,7 @@ export default {
       try {
         const resp = await this.$apollo.mutate({
           mutation: gql`
-            mutation ($tree: [NavigationTreeInput]!) {
+            mutation ($tree: [NavigationTreeInput]!, $mode: NavigationMode!) {
               navigation{
                 updateTree(tree: $tree) {
                   responseResult {
@@ -385,15 +385,24 @@ export default {
                     slug
                     message
                   }
+                },
+                updateConfig(mode: $mode) {
+                  responseResult {
+                    succeeded
+                    errorCode
+                    slug
+                    message
+                  }
                 }
               }
             }
           `,
           variables: {
-            tree: this.trees
+            tree: this.trees,
+            mode: this.config.mode
           }
         })
-        if (_.get(resp, 'data.navigation.updateTree.responseResult.succeeded', false)) {
+        if (_.get(resp, 'data.navigation.updateTree.responseResult.succeeded', false) && _.get(resp, 'data.navigation.updateConfig.responseResult.succeeded', false)) {
           this.$store.commit('showNotification', {
             message: this.$t('navigation.saveSuccess'),
             style: 'success',