提交 3f713db0 编写于 作者: S Simon Knox

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

上级 ced971b1
...@@ -14,6 +14,7 @@ require('./task_list'); ...@@ -14,6 +14,7 @@ require('./task_list');
if ($('a.btn-close').length) { if ($('a.btn-close').length) {
this.taskList = new gl.TaskList({ this.taskList = new gl.TaskList({
dataType: 'issue', dataType: 'issue',
fieldName: 'description',
selector: '.detail-page-description', selector: '.detail-page-description',
onSuccess: (result) => { onSuccess: (result) => {
document.querySelector('#task_status').innerText = result.task_status; document.querySelector('#task_status').innerText = result.task_status;
......
...@@ -29,6 +29,7 @@ require('./merge_request_tabs'); ...@@ -29,6 +29,7 @@ require('./merge_request_tabs');
if ($("a.btn-close").length) { if ($("a.btn-close").length) {
this.taskList = new gl.TaskList({ this.taskList = new gl.TaskList({
dataType: 'merge_request', dataType: 'merge_request',
fieldName: 'description',
selector: '.detail-page-description', selector: '.detail-page-description',
onSuccess: (result) => { onSuccess: (result) => {
document.querySelector('#task_status').innerText = result.task_status; document.querySelector('#task_status').innerText = result.task_status;
......
...@@ -53,6 +53,7 @@ require('./task_list'); ...@@ -53,6 +53,7 @@ require('./task_list');
this.setupMainTargetNoteForm(); this.setupMainTargetNoteForm();
this.taskList = new gl.TaskList({ this.taskList = new gl.TaskList({
dataType: 'note', dataType: 'note',
fieldName: 'note',
selector: '.notes' selector: '.notes'
}); });
this.collapseLongCommitList(); this.collapseLongCommitList();
......
...@@ -4,6 +4,7 @@ class TaskList { ...@@ -4,6 +4,7 @@ class TaskList {
constructor(options = {}) { constructor(options = {}) {
this.selector = options.selector; this.selector = options.selector;
this.dataType = options.dataType; this.dataType = options.dataType;
this.fieldName = options.fieldName;
this.onSuccess = options.onSuccess || (() => {}); this.onSuccess = options.onSuccess || (() => {});
this.init(); this.init();
} }
...@@ -24,7 +25,7 @@ class TaskList { ...@@ -24,7 +25,7 @@ class TaskList {
const $target = $(e.target); const $target = $(e.target);
const patchData = {}; const patchData = {};
patchData[this.dataType] = { patchData[this.dataType] = {
description: $target.val(), [this.fieldName]: $target.val(),
}; };
return $.ajax({ return $.ajax({
type: 'PATCH', type: 'PATCH',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册