update correct field for Notes - it's called note not description
This commit is contained in:
parent
ced971b12a
commit
3f713db0da
4 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -53,6 +53,7 @@ require('./task_list');
|
|||
this.setupMainTargetNoteForm();
|
||||
this.taskList = new gl.TaskList({
|
||||
dataType: 'note',
|
||||
fieldName: 'note',
|
||||
selector: '.notes'
|
||||
});
|
||||
this.collapseLongCommitList();
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue