Commit 9822c626 authored by Clement Ho's avatar Clement Ho

Use new issue order endpoint

parent ba517230
......@@ -95,7 +95,7 @@ export default {
const issueToRemove = _.find(this.state.relatedIssues, issue => issue.id === idToRemove);
if (issueToRemove) {
this.service.removeRelatedIssue(issueToRemove.destroy_relation_path)
this.service.removeRelatedIssue(issueToRemove.relation_path)
.then(res => res.json())
.then((data) => {
this.store.setRelatedIssues(data.issues);
......@@ -164,7 +164,10 @@ export default {
const issue = _.find(this.state.relatedIssues, issue => issue.id === issueId);
if (issue) {
this.service.saveIssueOrder(issue.epic_issue_id, newOrder);
this.service.saveRelatedIssueOrder({
endpoint: issue.related_path,
position: newOrder,
});
}
},
......
......@@ -6,7 +6,6 @@ Vue.use(vueResource);
class RelatedIssuesService {
constructor(endpoint) {
this.relatedIssuesResource = Vue.resource(endpoint);
this.reorderIssuesResource = Vue.resource(`${endpoint}{/id}/order`);
}
fetchRelatedIssues() {
......@@ -19,11 +18,11 @@ class RelatedIssuesService {
});
}
saveIssueOrder(issueId, position) {
return this.reorderIssuesResource.update({
id: issueId,
}, {
position,
saveRelatedIssueOrder({ endpoint, position }) {
return Vue.http.put(endpoint, {
epic: {
position,
},
});
}
......
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