update correct field for Notes - it's called note not description

This commit is contained in:
Simon Knox 2017-02-15 16:53:17 +11:00
parent ced971b12a
commit 3f713db0da
4 changed files with 5 additions and 1 deletions

View file

@ -14,6 +14,7 @@ require('./task_list');
if ($('a.btn-close').length) {
this.taskList = new gl.TaskList({
dataType: 'issue',
fieldName: 'description',
selector: '.detail-page-description',
onSuccess: (result) => {
document.querySelector('#task_status').innerText = result.task_status;

View file

@ -29,6 +29,7 @@ require('./merge_request_tabs');
if ($("a.btn-close").length) {
this.taskList = new gl.TaskList({
dataType: 'merge_request',
fieldName: 'description',
selector: '.detail-page-description',
onSuccess: (result) => {
document.querySelector('#task_status').innerText = result.task_status;

View file

@ -53,6 +53,7 @@ require('./task_list');
this.setupMainTargetNoteForm();
this.taskList = new gl.TaskList({
dataType: 'note',
fieldName: 'note',
selector: '.notes'
});
this.collapseLongCommitList();

View file

@ -4,6 +4,7 @@ class TaskList {
constructor(options = {}) {
this.selector = options.selector;
this.dataType = options.dataType;
this.fieldName = options.fieldName;
this.onSuccess = options.onSuccess || (() => {});
this.init();
}
@ -24,7 +25,7 @@ class TaskList {
const $target = $(e.target);
const patchData = {};
patchData[this.dataType] = {
description: $target.val(),
[this.fieldName]: $target.val(),
};
return $.ajax({
type: 'PATCH',