]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: toaster: importlayer Use new layer add API
authorMichael Wood <michael.g.wood@intel.com>
Fri, 9 Dec 2016 16:52:46 +0000 (16:52 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 12 Dec 2016 20:44:53 +0000 (20:44 +0000)
Switch the importlayer.js to use the new REST API for importing a new layer.

(Bitbake rev: 6475fd7e0d2488bf300b75322f2c00297cd1440b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/toaster/toastergui/static/js/importlayer.js

index 30dc28280ecc74efda8e256a4e7751cb3e1fd4b0..4784c657f537cfb69e806d440ec88fb5e5027d84 100644 (file)
@@ -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") {