Bladeren bron

Fix: Should not load repeated boards list

pull/177/head
winkidney 4 jaren geleden
bovenliggende
commit
fb6b4ddad3
2 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  1. +1
    -1
      pinry-spa/src/components/Boards.vue
  2. +3
    -2
      pinry-spa/src/components/api.js

+ 1
- 1
pinry-spa/src/components/Boards.vue Bestand weergeven

@@ -205,7 +205,7 @@ export default {
return;
}
this.status.loading = true;
const promise = API.fetchBoardForUser(this.boardUsername);
const promise = API.fetchBoardForUser(this.boardUsername, this.status.offset);
promise.then(
(resp) => {
const { results, next } = resp.data;


+ 3
- 2
pinry-spa/src/components/api.js Bestand weergeven

@@ -154,8 +154,9 @@ function fetchPinsForBoard(boardId) {
);
}

function fetchBoardForUser(username) {
const url = `${API_PREFIX}boards/?submitter__username=${username}`;
function fetchBoardForUser(username, offset = 0, limit = 50) {
const prefix = `${API_PREFIX}boards/?submitter__username=${username}`;
const url = `${prefix}&offset=${offset}&limit=${limit}`;
return axios.get(url);
}



Laden…
Annuleren
Opslaan