Browse Source

HUE-6242 [home] Actually perform document type filtering

Romain Rigaux 8 years ago
parent
commit
2470301873
1 changed files with 10 additions and 4 deletions
  1. 10 4
      desktop/core/src/desktop/static/desktop/js/apiHelper.js

+ 10 - 4
desktop/core/src/desktop/static/desktop/js/apiHelper.js

@@ -659,10 +659,10 @@ var ApiHelper = (function () {
       return;
       return;
     }
     }
 
 
-    $.ajax({
+    var parameters = {
       url: DOCUMENTS_API,
       url: DOCUMENTS_API,
       data: {
       data: {
-        uuid: options.uuid
+        uuid: options.uuid,
       },
       },
       success: function (data) {
       success: function (data) {
         if (! self.successResponseIsError(data)) {
         if (! self.successResponseIsError(data)) {
@@ -671,8 +671,14 @@ var ApiHelper = (function () {
           promise.reject(data);
           promise.reject(data);
         }
         }
       }
       }
-    })
-    .fail(promise.reject);
+    };
+
+    if (window.location.getParameter('type') !== '') {
+      parameters['data']['type'] = ['directory', window.location.getParameter('type')];
+      parameters['traditional'] = true;
+    }
+
+    $.ajax(parameters).fail(promise.reject);
   };
   };
 
 
   /**
   /**