bitbake: toaster: importlayer Use new layer add API

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>
This commit is contained in:
Michael Wood 2016-12-09 16:52:46 +00:00 committed by Richard Purdie
parent 7e80e501fb
commit f2b0d43c2f
1 changed files with 4 additions and 3 deletions

View File

@ -158,6 +158,7 @@ function importLayerPageInit (ctx) {
project_id: libtoaster.ctx.projectId, project_id: libtoaster.ctx.projectId,
layer_deps: layerDepsCsv, layer_deps: layerDepsCsv,
local_source_dir: $('#local-dir-path').val(), local_source_dir: $('#local-dir-path').val(),
add_to_project: true,
}; };
if ($('input[name=repo]:checked').val() == "git") { if ($('input[name=repo]:checked').val() == "git") {
@ -168,9 +169,9 @@ function importLayerPageInit (ctx) {
} }
$.ajax({ $.ajax({
type: "POST", type: "PUT",
url: ctx.xhrImportLayerUrl, url: ctx.xhrLayerUrl,
data: layerData, data: JSON.stringify(layerData),
headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
success: function (data) { success: function (data) {
if (data.error != "ok") { if (data.error != "ok") {