diff options
author | Lee Tickett <lee@tickett.net> | 2019-09-03 19:10:08 +0000 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2019-09-03 19:10:08 +0000 |
commit | 19371b9062664ccb75f61825da1924187750a6a9 (patch) | |
tree | e1f2e4e17dbb73659c83f7b9e268a321eb3780fa /app/assets/javascripts/sidebar/sidebar_mediator.js | |
parent | 5256f011834ae020f1957ae56e48b7bb57cafb0f (diff) | |
download | gitlab-ce-19371b9062664ccb75f61825da1924187750a6a9.tar.gz |
Revert "DB change, migratoin and changelog"
This reverts commit af5242ecb682189c5d8276e1ab1ffe5ce844f2e5.
Diffstat (limited to 'app/assets/javascripts/sidebar/sidebar_mediator.js')
-rw-r--r-- | app/assets/javascripts/sidebar/sidebar_mediator.js | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/app/assets/javascripts/sidebar/sidebar_mediator.js b/app/assets/javascripts/sidebar/sidebar_mediator.js index 643fe6c00b6..4a7000cbbda 100644 --- a/app/assets/javascripts/sidebar/sidebar_mediator.js +++ b/app/assets/javascripts/sidebar/sidebar_mediator.js @@ -32,7 +32,10 @@ export default class SidebarMediator { // If there are no ids, that means we have to unassign (which is id = 0) // And it only accepts an array, hence [0] - return this.service.update(field, selected.length === 0 ? [0] : selected); + const assignees = selected.length === 0 ? [0] : selected; + const data = { assignee_ids: assignees }; + + return this.service.update(field, data); } setMoveToProjectId(projectId) { @@ -42,8 +45,7 @@ export default class SidebarMediator { fetch() { return this.service .get() - .then(response => response.json()) - .then(data => { + .then(({ data }) => { this.processFetchedData(data); }) .catch(() => new Flash(__('Error occurred when fetching sidebar data'))); @@ -71,23 +73,17 @@ export default class SidebarMediator { } fetchAutocompleteProjects(searchTerm) { - return this.service - .getProjectsAutocomplete(searchTerm) - .then(response => response.json()) - .then(data => { - this.store.setAutocompleteProjects(data); - return this.store.autocompleteProjects; - }); + return this.service.getProjectsAutocomplete(searchTerm).then(({ data }) => { + this.store.setAutocompleteProjects(data); + return this.store.autocompleteProjects; + }); } moveIssue() { - return this.service - .moveIssue(this.store.moveToProjectId) - .then(response => response.json()) - .then(data => { - if (window.location.pathname !== data.web_url) { - visitUrl(data.web_url); - } - }); + return this.service.moveIssue(this.store.moveToProjectId).then(({ data }) => { + if (window.location.pathname !== data.web_url) { + visitUrl(data.web_url); + } + }); } } |