Commit 1de23708 authored by Phil Hughes's avatar Phil Hughes

Updated JSON endpoints

parent 7e7673d5
...@@ -2,8 +2,7 @@ class BoardService { ...@@ -2,8 +2,7 @@ class BoardService {
constructor (root) { constructor (root) {
Vue.http.options.root = root; Vue.http.options.root = root;
this.lists = Vue.resource(`${root}{/id}.json`, {}); this.lists = Vue.resource(`${root}/lists{/id}.json`, {}, {
this.list = Vue.resource(`${root}/lists{/id}.json`, {}, {
generate: { generate: {
method: 'POST', method: 'POST',
url: `${root}/lists/generate.json` url: `${root}/lists/generate.json`
...@@ -25,13 +24,13 @@ class BoardService { ...@@ -25,13 +24,13 @@ class BoardService {
generateDefaultLists () { generateDefaultLists () {
this.setCSRF(); this.setCSRF();
return this.list.generate({}); return this.lists.generate({});
} }
createList (labelId) { createList (labelId) {
this.setCSRF(); this.setCSRF();
return this.list.save({}, { return this.lists.save({}, {
list: { list: {
label_id: labelId label_id: labelId
} }
...@@ -41,7 +40,7 @@ class BoardService { ...@@ -41,7 +40,7 @@ class BoardService {
updateList (list) { updateList (list) {
this.setCSRF(); this.setCSRF();
return this.list.update({ id: list.id }, { return this.lists.update({ id: list.id }, {
list: { list: {
position: list.position position: list.position
} }
...@@ -51,7 +50,7 @@ class BoardService { ...@@ -51,7 +50,7 @@ class BoardService {
destroyList (id) { destroyList (id) {
this.setCSRF(); this.setCSRF();
return this.list.delete({ id }); return this.lists.delete({ id });
} }
getIssuesForList (id, filter = {}) { getIssuesForList (id, filter = {}) {
...@@ -62,12 +61,10 @@ class BoardService { ...@@ -62,12 +61,10 @@ class BoardService {
return this.issues.get(data); return this.issues.get(data);
} }
moveIssue (id, from, to) { moveIssue (id, from_list_id, to_list_id) {
return this.issue.update({ id }, { return this.issue.update({ id }, {
issue: { from_list_id,
from, to_list_id
to
}
}); });
} }
}; };
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