Add archive board

This commit is contained in:
Michael Weimann
2018-12-16 23:30:09 +01:00
parent 22744ee39c
commit 69ad41bb58
5 changed files with 94 additions and 32 deletions

View File

@@ -32,15 +32,36 @@ export class BoardApi {
return OC.generateUrl(url)
}
/**
* Updates a board.
*
* @param {Board} board
* @return Promise
*/
updateBoard(board) {
return axios.put(this.url(`/boards/${board.id}`), board)
.then(
(response) => {
return Promise.resolve(response.data)
},
(err) => {
return Promise.reject(err)
}
)
.catch((err) => {
return Promise.reject(err)
})
}
/**
* Creates a new board.
*
* @param {{String title, String color}} boardData The board data with title and color in hex format, e.g. "#ff0000"
* @param {{String title, String color, String hashedColor}} boardData The board data to send.
* hashedColor is the color in hex format, e.g. "#ff0000"
* color is the same color without the "#"
* @return Promise
*/
createBoard(boardData) {
boardData.color = boardData.color.substr(1)
return axios.post(this.url('/boards'), boardData)
.then(
(response) => {