diff --git a/pinry-spa/src/components/Pins.vue b/pinry-spa/src/components/Pins.vue index 4ede89a..f78bbbb 100644 --- a/pinry-spa/src/components/Pins.vue +++ b/pinry-spa/src/components/Pins.vue @@ -123,6 +123,8 @@ export default { promise = API.fetchPins(this.offset, this.pinFilters.tagFilter); } else if (this.pinFilters.userFilter) { promise = API.fetchPins(this.offset, null, this.pinFilters.userFilter); + } else if (this.pinFilters.boardFilter) { + promise = API.fetchPinsForBoard(this.pinFilters.boardFilter); } else { promise = API.fetchPins(this.offset); } diff --git a/pinry-spa/src/components/api.js b/pinry-spa/src/components/api.js index 7d4b54f..d4dc40d 100644 --- a/pinry-spa/src/components/api.js +++ b/pinry-spa/src/components/api.js @@ -18,6 +18,21 @@ function fetchPins(offset, tagFilter, userFilter) { ); } +function fetchPinsForBoard(boardId) { + const url = `${API_PREFIX}boards/${boardId}`; + return new Promise( + (resolve, reject) => { + axios.get(url).then( + (resp) => { + resolve({ data: { results: resp.data.pins_detail } }); + }, + error => reject(error), + ); + }, + ); +} + export default { fetchPins, + fetchPinsForBoard, }; diff --git a/pinry-spa/src/router/index.js b/pinry-spa/src/router/index.js index 07a6df2..db13d7f 100644 --- a/pinry-spa/src/router/index.js +++ b/pinry-spa/src/router/index.js @@ -3,6 +3,7 @@ import VueRouter from 'vue-router'; import Home from '../views/Home.vue'; import Pins4Tag from '../views/Pins4Tag.vue'; import Pins4User from '../views/Pins4User.vue'; +import Pins4Board from '../views/Pins4Board.vue'; Vue.use(VueRouter); @@ -22,6 +23,11 @@ const routes = [ name: 'user', component: Pins4User, }, + { + path: '/pins/boards/:boardId', + name: 'board', + component: Pins4Board, + }, ]; const router = new VueRouter({ diff --git a/pinry-spa/src/views/Pins4Board.vue b/pinry-spa/src/views/Pins4Board.vue new file mode 100644 index 0000000..c389d72 --- /dev/null +++ b/pinry-spa/src/views/Pins4Board.vue @@ -0,0 +1,40 @@ + + + + + + diff --git a/pinry-spa/src/views/Pins4Tag.vue b/pinry-spa/src/views/Pins4Tag.vue index 869d9c7..c1e5400 100644 --- a/pinry-spa/src/views/Pins4Tag.vue +++ b/pinry-spa/src/views/Pins4Tag.vue @@ -1,5 +1,5 @@