Commit 1e328844 authored by Jacob Schatz's avatar Jacob Schatz

Makes multiple file commits for realz.

parent 28d6fd18
...@@ -106,7 +106,8 @@ const Api = { ...@@ -106,7 +106,8 @@ const Api = {
'PRIVATE_TOKEN': token, 'PRIVATE_TOKEN': token,
}, },
type: 'POST', type: 'POST',
data: data, contentType: "application/json; charset=utf-8",
data: JSON.stringify(data),
dataType: 'json', dataType: 'json',
}) })
.done(commitData => callback(commitData)) .done(commitData => callback(commitData))
......
...@@ -22,6 +22,7 @@ function initRepo() { ...@@ -22,6 +22,7 @@ function initRepo() {
Store.currentBranch = $("button.dropdown-menu-toggle").attr('data-ref'); Store.currentBranch = $("button.dropdown-menu-toggle").attr('data-ref');
Store.checkIsCommitable(); Store.checkIsCommitable();
Store.projectId = repo.dataset.projectId; Store.projectId = repo.dataset.projectId;
Store.tempPrivateToken = repo.dataset.tempToken;
new Vue({ new Vue({
el: repo, el: repo,
......
...@@ -31,7 +31,7 @@ const RepoCommitSection = { ...@@ -31,7 +31,7 @@ const RepoCommitSection = {
} }
Api.commitMultiple(Store.projectId, payload, (data) => { Api.commitMultiple(Store.projectId, payload, (data) => {
console.log('got back', data); console.log('got back', data);
}) }, Store.tempPrivateToken);
} }
}, },
......
...@@ -22,6 +22,7 @@ const RepoStore = { ...@@ -22,6 +22,7 @@ const RepoStore = {
defaultTabSize: 100, defaultTabSize: 100,
minTabSize: 30, minTabSize: 30,
tabsOverflow: 41, tabsOverflow: 41,
tempPrivateToken: '',
activeFile: { activeFile: {
active: true, active: true,
binary: false, binary: false,
......
#repo{ data: { url: repo_url(@project), 'project-name' => @project.name, refs_url: refs_namespace_project_path(@project.namespace, @project, format: "json"), project_url: namespace_project_path(@project.namespace, @project), project_id: @project.id } } #repo{ data: { url: repo_url(@project), 'project-name' => @project.name, refs_url: refs_namespace_project_path(@project.namespace, @project, format: "json"), project_url: namespace_project_path(@project.namespace, @project), project_id: @project.id, temp_token: @current_user.private_token } }
- if can_edit_tree? - if can_edit_tree?
= render 'projects/blob/upload', title: _('Upload New File'), placeholder: _('Upload New File'), button_title: _('Upload file'), form_path: project_create_blob_path(@project, @id), method: :post = render 'projects/blob/upload', title: _('Upload New File'), placeholder: _('Upload New File'), button_title: _('Upload file'), form_path: project_create_blob_path(@project, @id), method: :post
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment