Skip to content

Commit

Permalink
minor api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
czytelny committed Aug 18, 2019
1 parent 8b07c87 commit a6098c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/cloud.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
login: "http://localhost:3000/api/loginUser",
boardsUrl(username) {
return `http://localhost:3000/api/boards?username=${username}`;
boardsUrl(username, lastSync) {
return `http://localhost:3000/api/boards?username=${username}&lastSync=${lastSync}`;
},
boardPatchUrl(username) {
return `http://localhost:3000/api/boards/patch?username=${username}`;
Expand Down
11 changes: 5 additions & 6 deletions src/repositories/syncRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export default {
initialSync(username, rawBoards, token, lastSync) {
return axios({
method: 'post',
url: cloudSettings.boardsUrl(username),
data: {boards: rawBoards, lastSync},
url: cloudSettings.boardsUrl(username, lastSync),
data: {boards: rawBoards},
headers: {'Authorization': `JWT ${token}`},
});
},
Expand All @@ -75,16 +75,15 @@ export default {
if (!queue || queue.length === 0) {
return axios({
method: 'get',
url: cloudSettings.boardsUrl(username),
data: {lastSync},
url: cloudSettings.boardsUrl(username, lastSync),
headers: {'Authorization': `JWT ${token}`},
});
}

return axios({
method: 'post',
url: cloudSettings.boardPatchUrl(username),
data: {queue, lastSync},
url: cloudSettings.boardPatchUrl(username, lastSync),
data: {queue},
headers: {'Authorization': `JWT ${token}`},
});
},
Expand Down

0 comments on commit a6098c7

Please sign in to comment.