[05/14] toaster: importlayer Use new layer add API

Submitted by Michael Wood on Dec. 9, 2016, 4:29 p.m. | Patch ID: 134952

Details

Message ID 1481300985-7356-6-git-send-email-michael.g.wood@intel.com
State New
Headers show

Commit Message

Michael Wood Dec. 9, 2016, 4:29 p.m.
Switch the importlayer.js to use the new REST API for importing a new layer.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
 bitbake/lib/toaster/toastergui/static/js/importlayer.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js
index 30dc282..4784c65 100644
--- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js
+++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js
@@ -158,6 +158,7 @@  function importLayerPageInit (ctx) {
         project_id: libtoaster.ctx.projectId,
         layer_deps: layerDepsCsv,
         local_source_dir: $('#local-dir-path').val(),
+        add_to_project: true,
       };
 
       if ($('input[name=repo]:checked').val() == "git") {
@@ -168,9 +169,9 @@  function importLayerPageInit (ctx) {
       }
 
       $.ajax({
-          type: "POST",
-          url: ctx.xhrImportLayerUrl,
-          data: layerData,
+          type: "PUT",
+          url: ctx.xhrLayerUrl,
+          data: JSON.stringify(layerData),
           headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
           success: function (data) {
             if (data.error != "ok") {